Intelligent analysis method for food supply and demand joint evolution based on machine learning model
By applying machine learning technologies such as principal component analysis, random forest model, Bayesian stratification and Markov chain Monte Carlo sampling in food supply and demand prediction, the problems of insufficient time representativeness, low computational efficiency and difficulty in capturing nonlinear relationships in the existing technology are solved, and higher precision food supply and demand prediction and systematic evaluation are achieved.
Patent Information
- Application Number
- CN202411620049.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-13
- Publication Date
- 2025-03-04
AI Technical Summary
The prior art has problems in the prediction of food supply and demand, such as insufficient time representation, low computational efficiency, difficulty in capturing the nonlinear complex relationships of agricultural production, and high computing resource consumption when processing high-dimensional data.
An intelligent analysis method based on machine learning model is adopted, and the output food production prediction is trained through principal component analysis and random forest model, and the food consumption prediction is predicted by combining Bayesian stratification and Markov chain Monte Carlo sampling, and finally analyzing the food supply and demand gap.
It improves the accuracy and data processing capabilities of food supply and demand prediction, can dynamically reflect changes in population consumption preferences in multiple dimensions, and evaluates the balance, stability and sustainability of the food system.
Smart Images

Figure CN119558589A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of the joint evolution of food supply and demand, and specifically refers to an intelligent analysis method for the joint evolution of food supply and demand based on a machine learning model. Background Art
[0002] Sustainable food production is an important issue of concern to China and the world. A large number of studies have shown that China's food supply and demand are still in a "tight balance", but there is great uncertainty in the medium and long term. Factors affecting changes in food production include but are not limited to natural resources, agricultural mechanization level, intensive use of cultivated land, production technology level, agricultural labor and other factors.
[0003] In terms of food consumption, the current global food consumption pattern is experiencing a shift towards unhealthy diets, characterized by excessive intake of sugar, trans fats, red meat and processed meat, and insufficient consumption of vegetables, fruits and whole grains.
[0004] Especially as our economy continues to grow, affluent and more Westernized dietary patterns will become more prevalent, bringing additional economic, health, and environmental challenges.
[0005] Regional differences and dynamic evolution of food consumption and production still need further in-depth research, especially for countries in rapid demographic transition to assess the gap between food supply and demand to ensure food security.
[0006] Therefore, it is crucial to take action to create a food production and consumption environment that promotes sustainable diets.
[0007] Most of the existing agricultural yield forecasting research methods are divided into three categories: linear econometric models, crop models, and machine learning models. Linear econometric models, such as those based on the Cobb-Douglas production function or linear regression, can quantify the additive effect of each variable, but they are difficult to capture the nonlinear interactions between agricultural production variables, which often leads to low prediction accuracy, especially when dealing with complex agricultural data;
[0008] Crop models (such as crop grid models and global equilibrium models) provide global agricultural production forecasts by integrating geospatial data and macroeconomic data.
[0009] However, the high complexity of the model and its strong dependence on the quality of input data make it difficult to interpret its results, and most of them focus on the global scale, which makes it difficult to meet the needs of refined predictions at the provincial and municipal levels. Although relevant studies have applied machine learning models, such as artificial neural network models and random forests, these models have shown significant advantages in capturing complex nonlinear relationships in agricultural production, and can process high-dimensional and complex data and achieve high-precision predictions.
[0010] Therefore, existing research and applications still have problems such as high computing resource consumption and data redundancy when processing multiple agricultural input factors simultaneously.
[0011] In terms of food consumption prediction, the influencing factors are more complex. Many studies have been conducted on the relationship between population growth, age structure, urban-rural structure, income level, occupation and food consumption. Traditional food consumption prediction methods are mostly based on historical consumption data to build multivariate regression models. Although they are intuitive and easy to use, they are difficult to deal with complex multi-level data structures. Other studies use the recommended per capita food intake based on dietary patterns for scenario simulation. However, this type of method is difficult to dynamically reflect the changes in multi-dimensional population consumption preferences. The Bayesian hierarchical-Markov chain Monte Carlo machine learning model has strong flexibility in predicting food consumption and has been widely used to simulate food consumption and nutritional intake in countries around the world.
[0012] However, as the data dimension of the model increases, the results will be more difficult to interpret, the computing resources will be more intensive, and it will be highly dependent on the representativeness of the prior information.
[0013] In summary, there are several problems that need to be solved in existing research technologies: first, the update speed of food micro-consumption data is slow, resulting in insufficient temporal representativeness of existing research; second, traditional prediction models are difficult to effectively capture the nonlinear and complex relationships in agricultural production, and have low computational efficiency when processing high-dimensional data; finally, existing research rarely conducts a comprehensive linkage analysis of food production and consumption, making it difficult to provide comprehensive predictive support for the balance of food supply and demand. Summary of the invention
[0014] The technical problem to be solved by the present invention is to overcome the above technical defects and provide an intelligent analysis method for the joint evolution of food supply and demand based on a machine learning model, aiming to improve the capabilities of the existing system in prediction accuracy, data processing and supply and demand balance analysis.
[0015] To solve the above technical problems, the technical solution provided by the present invention is: an intelligent analysis method for the joint evolution of food supply and demand based on a machine learning model, comprising the following steps: S1: determining basic data for input and preprocessing, including obtaining food production history data and food consumption history data, and performing data cleaning; S2: constructing a food supply and demand prediction model, including: selecting agricultural production factors to output food production predictions through principal component analysis and random forest model training; constructing a Bayesian hierarchical model, using Markov chain Monte Carlo sampling for multi-layer social attribute modeling, and outputting food consumption predictions; S3: performing food supply and demand gap analysis based on the food consumption prediction and food production prediction obtained in S2 to obtain the temporal dynamic changes and spatial differentiation evolution characteristics of the food supply and demand situation; S4: analyzing the supply and demand of the regional food system based on the supply and demand prediction and gap analysis obtained in S3, including balance, stability and sustainability.
[0016] Preferably, the food production history data in S1 includes provincial and municipal statistical yearbooks and provincial rural statistical yearbooks, specifically including sown area, total mechanical power, and fertilizer usage;
[0017] The historical data on food consumption include provincial and municipal statistical yearbooks for multiple years and regions, and data on the consumption of major food items.
[0018] Preferably, the input basic data is processed using rule-based and data-driven cleaning strategies, including outlier detection and missing value filling.
[0019] Preferably, the principal component analysis dimensionality reduction process includes:
[0020] Step 1: Standardize the data of agricultural production input factors, including sown area, mechanical power, fertilizer usage, and agricultural labor;
[0021] Step 2: Calculate the covariance matrix based on the standardized data to quantify the linear relationship between variables and find the correlation of agricultural production variables;
[0022] Step 3: Eigenvalue decomposition: by performing eigenvalue decomposition on the covariance matrix, the eigenvalues and eigenvectors of the variables are obtained, and the high-dimensional data are reduced to the new principal components of agricultural production inputs;
[0023] Step 4: Calculate the cumulative variance contribution rate and select the principal component whose cumulative variance contribution rate is greater than 90%;
[0024] Step 5: Calculate the principal component scores, project the original data into the principal component space through the principal component matrix, obtain the principal component scores of each sample, and input the selected principal components (Z1, Z2, Z3) into the food production prediction random forest model.
[0025] Preferably, the random forest machine learning model training includes:
[0026] Step 1: Build a random forest model on the principal component data after PCA dimensionality reduction, set the key parameters of the random forest model, including the number of decision trees and the number of variables randomly selected for each tree, and adjust them after multiple iterations to balance the accuracy and computational efficiency of food production prediction;
[0027] Step 2: Use the Bootstrap sampling method to randomly sample the training data to generate different data subsets, train each decision tree, and each subset has the same size as the original data set and allows repeated sampling to capture different data features during the model training process;
[0028] Step 3: Train the decision tree. Build a decision tree for each Bootstrap subset. Each tree selects the optimal split point by maximizing information gain or minimizing the Gini index. Each tree completes feature segmentation independently to ensure that the nonlinear relationship between agricultural production variables is effectively captured.
[0029] Step 4: Random forest generates the final prediction result by integrating the prediction results of all decision trees;
[0030] Step 5: Variable importance assessment, by calculating the contribution of each variable to the model purity at the splitting nodes in all decision trees, automatically identifying the variables that contribute most to yield prediction;
[0031] Step 6: Model performance evaluation: evaluate the model's food production prediction performance by randomly splitting the data set multiple times, using 70% training set and 30% test set; adjust the random forest parameters based on the model's real-time feedback and prediction error to ensure prediction accuracy in different scenarios.
[0032] Preferably, the construction of the Bayesian hierarchical model includes:
[0033] Step 1: Design a hierarchical structure of social attributes, classify consumer preferences, obtain the prior distribution of each group, and introduce restricted spline functions for variables J with nonlinear effects and high-dimensional complexity;
[0034] Step 2: Time trend modeling, integrating data from multiple years to build a time series model and identify long-term behavioral changes;
[0035] Step 3: Dynamic and intelligent adjustment of prior information. The dynamic adjustment of prior information is based on historical data and the latest market trends.
[0036] Step 4: Model verification and automatic tuning. Based on historical prediction error feedback, the hierarchical structure settings are automatically adjusted, model parameters are dynamically optimized, model performance is evaluated using cross-validation technology, and the model is tuned iteratively multiple times.
[0037] Preferably, the Markov chain Monte Carlo sampling includes:
[0038] Step 1: Design a hybrid sampling strategy based on data characteristics and model complexity. Use Gibbs sampling for conditionally independent variables and an adaptive version of No-U-Turn Sampler for high-dimensional complex variables or restricted variables.
[0039] Step 2: Multi-chain parallel sampling, dynamic allocation of computing resources, automatic adjustment of the number of chains according to the sampling convergence speed, to ensure the efficient operation of complex Bayesian models;
[0040] Step 3: Dynamically adjust the sampling step size. Dynamically adjust the MCMC sampling step size according to the changes in parameters during the sampling process. By real-time monitoring of changes in parameter distribution, the sampling process is automatically adjusted to ensure that the sampling efficiency of the model is always in the best state under different data sets and application scenarios.
[0041] Step 4: Automatic feedback optimization: During the sampling process, the sampling parameters are optimized according to the sampling quality and model error rate, the convergence time is reduced, and the sampling quality is improved.
[0042] Preferably, S3 includes comparing the results based on the food production prediction and the food consumption prediction.
[0043] Preferably, the regional food supply and demand balance assessment includes calculating the food self-sufficiency rate of each region based on regional production and consumption data provided by food production forecasts and food consumption forecasts;
[0044] The regional food supply and demand stability assessment includes calculating regional food production volatility and regional food consumption volatility indicators based on time series data of food production and food consumption in each region;
[0045] The sustainability assessment of regional food supply and demand includes predicting future food trade, supply and consumption relationships through a multi-regional input-output model based on regional input-output tables and historical food data, generating a food flow matrix, and using ecological network analysis methods to calculate resilience, redundancy and efficiency indicators.
[0046] Compared with the prior art, the advantages of the present invention are: an efficient and accurate intelligent analysis technology framework for the joint evolution of food supply and demand based on machine learning models is constructed, providing intelligent and dynamic decision-making support for achieving food security in my country in the medium and long term;
[0047] The random forest machine learning model constructed by the present invention has a high prediction accuracy in capturing the complex nonlinear relationship between various factors that affect food production; combined with the Bayesian hierarchical and Markov chain Monte Carlo simulation machine learning models, the present invention can accurately predict the trend of food consumption changes with high sampling efficiency. This helps to determine the key factors that affect the evolution of the gap between food supply and demand;
[0048] The present invention evaluates the balance, stability and sustainability of food supply and demand in each region through data-driven supply and demand forecasting and gap analysis, which can help decision makers better plan urban food production and consumption management, optimize agricultural production resource allocation, and formulate sustainable food consumption policies. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] Figure 1 Schematic diagram of the intelligent analysis technology framework for the joint evolution of food supply and demand based on machine learning models.
[0050] Figure 2 It is a food production prediction module based on machine learning.
[0051] Figure 3 It is a food consumption prediction module based on machine learning. DETAILED DESCRIPTION
[0052] The present invention is further described in detail below in conjunction with the accompanying drawings.
[0053] An intelligent analysis method for the joint evolution of food supply and demand based on a machine learning model, including:
[0054] Data input and preprocessing:
[0055] 1) Basic data input module:
[0056] A. Food production-related data: By integrating various data sources from multiple years and regions (such as provincial and municipal statistical yearbooks, provincial rural statistical yearbooks), key variables that affect food production are obtained, including but not limited to sown area, total machinery power, fertilizer usage, etc.
[0057] B. Food consumption related data: Collect data on major food consumption in different regions based on provincial and municipal statistical yearbooks; organize food micro-consumption data from multiple years and regions.
[0058] Data cleaning module: adopts rule-based and data-driven cleaning strategies, including outlier detection and missing value filling methods; standardizes all data to ensure data consistency and applicability.
[0059] Food supply and demand forecasting model construction:
[0060] Principal Component Analysis (PCA) dimensionality reduction processing:
[0061] Technical background and existing technical problems: Traditional food production prediction models often face problems of multicollinearity and data redundancy when processing multidimensional agricultural production data, which will increase the complexity of the model and reduce computational efficiency.
[0062] Technical means: Principal component analysis is used to reduce the dimension of various agricultural production input factors (including but not limited to variables such as sown area, mechanical power, fertilizer usage, and agricultural labor). That is, multiple highly correlated variables are converted into a few principal component variables to maximize the data variance; the contribution rate of each principal component is calculated, and only the principal component that best explains the data variation is retained.
[0063] principle:
[0064] Data Standardization:
[0065] Where: X is the original data matrix, each column is a feature, each row is a sample, μ is the mean of each feature, and σ is the standard deviation of each feature.
[0066] Compute the covariance matrix:
[0067] Where:
[0068] Σ is the covariance matrix of X, n is the number of samples, X T is the transpose of the data matrix
[0069] Calculate the eigenvalue: ∑v i =λ i v i
[0070] Where:
[0071] λ i is the eigenvalue of the covariance matrix Σ, v i is the corresponding eigenvector.
[0072] Data is projected into the principal component space: Y = XW k
[0073] Where:
[0074] W k is a matrix consisting of the first k eigenvectors, X is the original data matrix, and Y is the low-dimensional data after projection.
[0075] Random Forest (RF) machine learning model training:
[0076] Technical background and existing technical problems: Traditional linear regression models have limited performance in dealing with nonlinear relationships between complex agricultural production variables, and linear models cannot flexibly handle high-dimensional input features, and are prone to overfitting or underfitting problems.
[0077] Technical means: Random forest processes high-dimensional agricultural data by integrating multiple decision trees to capture the complex nonlinear relationship between agricultural production variables; randomly samples training data through Bootstrap sampling technology to reduce the risk of overfitting; automatically identifies and sorts the variables that contribute most to the food production prediction results through variable importance sorting technology; evaluates the food production prediction performance of the model by randomly splitting the data set, and dynamically optimizes parameters according to variable contribution.
[0078] Principle of the method: It is an integrated machine learning method that makes predictions by integrating multiple decision trees. It has the following advantages: First, it can handle the complex nonlinear relationship between the variable and the target variable; second, it can capture the interaction between the input variables through the splitting method of the decision tree; third, by integrating multiple decision trees, it reduces the overfitting problem of a single decision tree and has high robustness;
[0079]
[0080] Where:
[0081] ——Represents the predicted value of random forest for input data X;
[0082] T——represents a total of T decision trees (also called base learners);
[0083] f t (X)——the prediction of the t-th decision tree for input X;
[0084] 1 / T — average the results of all trees (in regression tasks);
[0085] Where:
[0086] Y: The response variable (target variable), which is the food production outcome we are trying to predict.
[0087] Z: independent variable (characteristic or input variable), which represents the input information of the model (agricultural production related variables).
[0088] f(Z): represents the relationship between the input variable Z and the response variable Y. This function can be linear or nonlinear, depending on the choice of model.
[0089] ε: Error term, representing the part of Y that cannot be fully explained by f(Z). It usually reflects the noise or random errors of the model.
[0090] Example steps to build a food production prediction module:
[0091] Taking the prediction of grain production as an example, the most basic agricultural production factors are selected and included in the empirical model, including but not limited to labor input factors, grain planting area, total power of grain agricultural machinery, and pure amount of grain agricultural fertilizer. Through principal component analysis, the multi-dimensional original agricultural production factors are reduced in dimension according to data categories and converted into multiple principal component variables (Z1, Z2, Z3). The specific steps are as shown in the attached figure. Figure 2 .
[0092] Principal component analysis dimensionality reduction processing:
[0093] Step 1: Standardize agricultural production input factor data to ensure that data of different dimensions are comparable and to avoid excessive impact of variables with too large a numerical range on the model;
[0094] Step 2: Calculate the covariance matrix based on the standardized data to quantify the linear relationship between variables and find out which agricultural production variables have a strong correlation;
[0095] Step 3: Eigenvalue decomposition, by performing eigenvalue decomposition on the covariance matrix, the eigenvalues and eigenvectors of the variables are obtained, thereby reducing the high-dimensional data to a few new principal components of agricultural production inputs;
[0096] Step 4: Calculate the cumulative variance contribution rate and select the principal component with a cumulative variance contribution rate greater than 90%. The principal component required to be retained can usually retain the information of the original data to the maximum extent and significantly reduce the complexity of the model;
[0097] Step 5: Calculate the principal component scores, project the original data into the principal component space through the principal component matrix, obtain the principal component scores of each sample, and input the selected principal components (Z1, Z2, Z3) into the food production prediction random forest model.
[0098] Random Forest Machine Learning Model Training:
[0099] Step 1: Build a random forest model on the principal component data after PCA dimensionality reduction, set the key parameters of the random forest model, including the number of decision trees and the number of variables randomly selected for each tree, and adjust them after multiple iterations to balance the accuracy and computational efficiency of food production prediction;
[0100] Step 2: Use the Bootstrap sampling method to randomly sample the training data to generate different data subsets for training each decision tree. Each subset has the same size as the original data set and allows repeated sampling to capture different data features during the model training process;
[0101] Step 3: Train the decision tree and build a decision tree for each Bootstrap subset. Each tree selects the optimal split point based on the method of maximizing information gain or minimizing the Gini index. Each tree completes feature segmentation independently to ensure that the nonlinear relationship between agricultural production variables is effectively captured;
[0102] Step 4: Random forest generates the final prediction result by integrating the prediction results of all decision trees;
[0103] Step 5: Variable importance assessment, by calculating the contribution of each variable to the model purity at the splitting nodes in all decision trees, automatically identifying the variables that contribute most to yield prediction;
[0104] Step 6: Model performance evaluation: evaluate the model’s food production prediction performance by randomly splitting the data set multiple times (70% training set, 30% test set); dynamically and intelligently adjust the random forest parameters based on the model’s real-time feedback and prediction error to ensure optimal prediction accuracy in different scenarios.
[0105] Bayesian Hierarchical Model (BHM) Construction:
[0106] Technical background and existing technical problems: When processing consumer behavior data with a multi-level structure, existing models often find it difficult to accurately capture the subtle differences between different groups of people and cannot effectively utilize existing prior information.
[0107] Technical means: The model is based on historical data on micro-consumption of food. It obtains prior distribution by stratifying consumer groups according to social attribute characteristics, processes the multi-level structure in the data, and ensures the accurate capture of food consumption behavior and preferences; integrates time-layer information from multiple years to further strengthen the estimation of the time trend of food consumption and ensure that the prediction model can reflect long-term changes in consumption behavior; and dynamically adjusts prior information based on historical data and the latest consumption trends.
[0108] Principle: Using Bayesian inference, the posterior distribution is obtained by combining the prior distribution and the likelihood function. The hierarchical structure allows parameters at different levels to share information. The nested hierarchical structure can be used to estimate consumer food choice preferences. By dividing the consumer population into different social attribute levels, the multi-level structure in the data is processed to improve the accuracy of the estimation.
[0109] Assume that the population attribute categories included in the model are J social attributes (if they have nonlinear effects), K social attributes, and L social attributes. Among them, the restricted cubic splines (RCS) are used to model the impact of J social attributes on food consumption to capture the nonlinear changes of this effect. In the Bayesian model, 3-5 nodes are selected to construct the basis functions (and) of the restricted spline function, and the coefficients of these basis functions are introduced as parameters in the model.
[0110]
[0111]
[0112] β j [z h ]=β 1j [z h ]+β 2j [S1]+β 3j [S2]
[0113] In the formula, Zh represents the median value of J social attribute grouping, k1, k2, k3, k4 represent the specific attribute values β corresponding to specific nodes 1j , β 2j , β 3j , the coefficients corresponding to each basis function need to be determined through model fitting.
[0114] Based on this, a Bayesian hierarchical model for people with different social attributes will be constructed. The basic formula is as follows:
[0115] y jkl ~Normal(μ jkl , σ 2 )
[0116] μ jkl =β j +γ k +δ l +∈ m +η jkl
[0117] β 1j , β 2j , β 3j ~Normal(μ β , τ 2 )
[0118] γ k ~Normal(μ γ , τ 2 )
[0119] δ1~Normal(μ δ , τ2 )
[0120] ∈ m ~Normal(μ ∈ , τ 2 )
[0121] In the formula, y jkl is the observed value of food consumption for the jth group of social attributes of type J, the kth group of social attributes of type K, and the first group of social attributes of type L, μ jkl is the average value of the level, σ 2 is the error variance, β j is the J-type social attribute effect, γ k is the K-type social attribute effect, δ l is the L-type social attribute effect, ∈ m is the food category effect, and η jkl is the residual term, which is used to capture the unexplained variation. The prior distribution of each level effect can be set as a normal distribution.
[0122] Markov chain Monte Carlo (MCMC) sampling:
[0123] Technical background and existing technical problems: Bayesian models usually involve high-dimensional parameter estimation. Directly solving the posterior distribution is usually very difficult and computationally intensive, and existing sampling methods are inefficient.
[0124] Technical means: Design a more targeted hybrid sampling strategy, use Gibbs sampling and No-U-Turn sampling and other techniques to efficiently sample different variable characteristics and complexities to improve sampling efficiency; combine multi-chain parallel sampling technology to accelerate the convergence of the model in high-dimensional nonlinear parameter space. Develop a model parameter feedback optimization mechanism, that is, the sampling results are directly used to update the model parameters and improve the prediction accuracy, to ensure that the consumption prediction model can output high-quality posterior distribution in real time for further analysis.
[0125] Principle: It is an algorithm for approximating complex probability distributions through random sampling, especially widely used in Bayesian statistics. The core idea of MCMC is to construct a Markov chain so that its sample distribution gradually converges to the target distribution (usually the posterior distribution), so that these samples can be used for statistical inference.
[0126]
[0127] Where: p(θ|D) is the posterior distribution of parameter θ; p(D|θ) is the likelihood function, that is, the probability of observing data given parameter θ; p(θ) is the prior distribution of θ; p(D) is the marginal likelihood of the observed data;
[0128] Specific steps to build a food consumption prediction module:
[0129] Taking food consumption as an example, the specific steps of the Bayesian hierarchical-Markov chain Monte Carlo machine learning model are shown in the attached Figure 3 .
[0130] Assume that the population attribute categories included in the model are J social attributes (if they have nonlinear effects), K social attributes, and L social attributes.
[0131] Bayesian hierarchical model construction:
[0132] Step 1: Design a hierarchical structure of social attributes to classify consumer preferences and obtain the prior distribution of each group; introduce restricted spline functions for variables J with nonlinear effects and high-dimensional complexity;
[0133] Step 2: Time trend modeling, integrating data from multiple years to build a time series model and identify long-term behavioral changes;
[0134] Step 3: Dynamic and intelligent adjustment of prior information. The dynamic adjustment of prior information is based on historical data and the latest market trends, so that the model can flexibly respond to changes in consumer behavior, especially in the case of missing data or delayed data updates, while still maintaining the robustness of the prediction.
[0135] Step 4: Model validation and automatic tuning: Based on historical prediction error feedback, automatically adjust the hierarchical structure settings, dynamically optimize model parameters, combine cross-validation technology to evaluate model performance, and iterate the model multiple times to ensure its robustness and prediction accuracy.
[0136] Markov Chain Monte Carlo Sampling:
[0137] Step 1: Design a hybrid sampling strategy based on data characteristics and model complexity. Use Gibbs sampling for simpler, conditionally independent variables, such as K-type social attributes and L-type social attributes. Use the adaptive version of No-U-Turn Sampler (NUTS) for high-dimensional complex variables or variables with more restrictions, such as J-type social attribute variables that need to be processed by restrictive spline functions.
[0138] Step 2: Multi-chain parallel sampling, the system dynamically allocates computing resources and automatically adjusts the number of chains according to the sampling convergence speed to ensure that complex Bayesian models can run efficiently in a large-scale data environment.
[0139] Step 3: Dynamically adjust the sampling step size. Dynamically adjust the MCMC sampling step size according to the changes in parameters during the sampling process to avoid falling into the local optimal solution or low sampling efficiency. By real-time monitoring of parameter distribution changes, the sampling process is automatically adjusted to ensure that the sampling efficiency of the model is always in the best state under different data sets and application scenarios.
[0140] Step 4: Automatic feedback optimization: During the sampling process, the sampling quality and model error rate are automatically adjusted, and the sampling parameters are optimized through intelligent algorithms to reduce convergence time and improve sampling quality.
[0141] Food supply and demand gap analysis and decision support:
[0142] Technical background and existing technical problems: Traditional food supply and demand forecasting systems often only focus on the supply or demand situation within a region, and it is difficult to effectively reflect the balance and stability of regional food supply and demand. When facing complex food trade relations, existing models lack sustainable quantitative evaluation methods for system resilience, redundancy and efficiency, and it is difficult to support intelligent decision-making in emergencies.
[0143] Food supply and demand gap analysis module: Based on the previous food production prediction module and consumption prediction module, the output results of the two modules are compared to analyze the temporal dynamic changes and spatial differentiation evolution characteristics of food supply and demand.
[0144] Intelligent decision support module: When supply and demand anomalies occur, it evaluates the balance, stability and sustainability of the regional food system supply and demand in multiple dimensions, and provides intelligent decision support for simulating the evolution of food supply and demand differences in my country in the medium and long term.
[0145] Regional food supply and demand balance assessment
[0146] Technical means: Using the regional production and consumption data provided by the production prediction module (PCA dimensionality reduction and random forest model) and the consumption prediction module (Bayesian stratification and MCMC sampling), the food self-sufficiency rate of each region is calculated. This indicator is used to assess whether the region has self-sufficiency capacity.
[0147] Method principle and steps:
[0148] Step 1: Input parameters, regional food production P i,t and regional food consumption C i,t
[0149] Step 2: Calculate the Regional Food Self-Sufficiency Rate (RFSSR) for a particular year
[0150]
[0151] Step 3: The output variable is RFSSR. A RFSSR value less than 1 indicates that the region is undersupplied; a value greater than 1 indicates that the region is more than self-sufficient.
[0152] Regional food supply and demand stability assessment
[0153] Technical means: Based on the time series data of production and consumption in each region, the regional food production volatility and regional food consumption volatility indicators are calculated. By analyzing these volatility, the stability of regional supply and demand can be quantified, high volatility areas can be identified, and corresponding preventive measures can be formulated.
[0154] Method principle and steps:
[0155] Step 1: Input parameters, food production P in region i in year t i,t , average historical food production in region i Food consumption in region i in year t C i,t , and historical average food consumption in the region
[0156] Step 2: Calculate Regional Food Production Variability (RFPV) and Regional Food Consumption Variability (RFCV)
[0157]
[0158]
[0159] Step 3: The output variables are RFPV and RFCV values. High volatility indicates that the supply and demand in the region fluctuate greatly and have poor stability.
[0160] Sustainability Assessment of Regional Food Systems
[0161] Technical means: Based on regional input-output tables and historical food data, a multi-regional input-output model is used to predict future food trade, supply and consumption relationships and generate a food flow matrix. Then, ecological network analysis methods are used to calculate indicators such as resilience, redundancy and efficiency to measure the sustainability of the system.
[0162] Method principle and steps:
[0163] Step 1: Input parameters: Regional input-output table, regional historical / forecasted food supply and consumption data
[0164] Step 2: Based on the existing regional input-output table and historical food production and consumption data, use the multi-regional input-output model to calculate the net export and net import of each region to characterize the food flow F(i,j) between regions. Based on the regional food production and food consumption forecast values, update the multi-regional input-output model to obtain the future food flow matrix.
[0165] Step 3: Based on the construction of regional food trade relations, the resilience, redundancy and efficiency of the system are evaluated using ecological network analysis. Resilience (R) indicates the system's ability to recover in the event of an emergency. The higher the value, the stronger the system's ability to adapt to external shocks. Redundancy (Rd) reflects the flexibility of the system's resource allocation. The higher the value, the more diverse the system's resource flow paths. Efficiency (Efficiency, E) measures the rationality of the system's resource utilization. A high value indicates optimal resource allocation, while a low value indicates insufficient resource utilization.
[0166]
[0167]
[0168]
[0169] Step 4: Output variables resilience R, redundancy Rd, and efficiency E.
[0170] The present invention reduces the dimension of agricultural production input factors with multicollinearity based on principal component analysis, reduces data redundancy, optimizes feature selection, and thus significantly improves computing efficiency and data interpretation capabilities; at the same time, the random forest machine learning model is trained to capture the complex nonlinear relationship between variables, thereby improving the accuracy and stability of food yield prediction;
[0171] For food consumption, a food consumption prediction model is constructed based on the Bayesian hierarchical-Markov chain Monte Carlo machine learning model. The first layer is used to characterize the consumer's food consumption preference characteristics and capture the heterogeneity between different groups. The second layer introduces the time dimension to strengthen the estimation of long-term consumption trends. To improve the computational efficiency of the model, the Markov chain Monte Carlo sampling strategy is further optimized. Through the efficient posterior distribution sampling mechanism, the consumption of computing resources is significantly reduced and the convergence speed of the model is improved.
[0172] By combining these two types of machine learning models, the present invention can realize the linkage prediction of future food production and consumption. Combined with ecological network analysis technology, it can evaluate the characteristics of the three dimensions of supply and demand balance, stability and sustainability of the regional food system, and provide intelligent, data-driven decision support for agricultural production and food consumption management, helping decision makers to better respond to changes in supply and demand in a dynamic environment, and improve resource allocation efficiency and the accuracy of supply chain management.
[0173] The present invention and its embodiments are described above, and such description is not restrictive. The drawings show only one embodiment of the present invention, and the actual structure is not limited thereto. In short, if ordinary technicians in the field are inspired by it, without departing from the purpose of the invention, they can design a structure and embodiment similar to the technical solution without creativity, which should belong to the protection scope of the present invention.
Claims
1. An intelligent analysis method for the joint evolution of food supply and demand based on a machine learning model, characterized by: The following steps are involved: S1: Determine basic data for input and preprocessing, including obtaining food production history data and food consumption history data, and performing data cleaning; S2: Construct a food supply and demand forecasting model, including: selecting agricultural production factors and outputting food production forecasts through principal component analysis and random forest model training; Construct a Bayesian hierarchical model and use Markov chain Monte Carlo sampling to model multi-layer social attributes and output food consumption predictions; S3: Based on the food consumption forecast and food production forecast obtained in S2, the food supply and demand gap analysis is performed to obtain the temporal dynamic changes and spatial differentiation evolution characteristics of food supply and demand; S4: Analyze the supply and demand of the regional food system based on the supply and demand forecast and gap analysis obtained in S3, including balance, stability and sustainability.
2. The intelligent analysis method of the joint evolution of food supply and demand based on a machine learning model according to claim 1, characterized in that: The food production history data in S1 include provincial and municipal statistical yearbooks and provincial rural statistical yearbooks, specifically including sown area, total machinery power, and fertilizer usage; The historical data on food consumption include provincial and municipal statistical yearbooks for multiple years and regions, and data on the consumption of major food items.
3. The intelligent analysis method of the joint evolution of food supply and demand based on a machine learning model according to claim 2, characterized in that: The input basic data is processed using rule-based and data-driven cleaning strategies, including outlier detection and missing value filling.
4. The intelligent analysis method of the joint evolution of food supply and demand based on a machine learning model according to claim 1, characterized in that: The principal component analysis dimensionality reduction process includes: Step 1: Standardize the data of agricultural production input factors, including sown area, mechanical power, fertilizer usage, and agricultural labor; Step 2: Calculate the covariance matrix based on the standardized data to quantify the linear relationship between variables and find the correlation of agricultural production variables; Step 3: Eigenvalue decomposition: by performing eigenvalue decomposition on the covariance matrix, the eigenvalues and eigenvectors of the variables are obtained, and the high-dimensional data are reduced to the new principal components of agricultural production inputs; Step 4: Calculate the cumulative variance contribution rate and select the principal component whose cumulative variance contribution rate is greater than 90%; Step 5: Calculate the principal component scores, project the original data into the principal component space through the principal component matrix, obtain the principal component scores of each sample, and input the selected principal components into the food production prediction random forest model.
5. The intelligent analysis method of the joint evolution of food supply and demand based on a machine learning model according to claim 1 or 4, characterized in that: The random forest machine learning model training includes: Step 1: Build a random forest model on the principal component data after PCA dimensionality reduction, set the key parameters of the random forest model, including the number of decision trees and the number of variables randomly selected for each tree, and adjust them after multiple iterations to balance the accuracy and computational efficiency of food production prediction; Step 2: Use the Bootstrap sampling method to randomly sample the training data to generate different data subsets, train each decision tree, and each subset has the same size as the original data set and allows repeated sampling to capture different data features during the model training process; Step 3: Train the decision tree. Build a decision tree for each Bootstrap subset. Each tree selects the optimal split point by maximizing information gain or minimizing the Gini index. Each tree completes feature segmentation independently to ensure that the nonlinear relationship between agricultural production variables is effectively captured. Step 4: Random forest generates the final prediction result by integrating the prediction results of all decision trees; Step 5: Variable importance assessment, by calculating the contribution of each variable to the model purity at the splitting nodes in all decision trees, automatically identifying the variables that contribute most to yield prediction; Step 6: Model performance evaluation: evaluate the model's food production prediction performance by randomly splitting the data set multiple times, using 70% training set and 30% test set; adjust the random forest parameters based on the model's real-time feedback and prediction error to ensure prediction accuracy in different scenarios.
6. The intelligent analysis method of the joint evolution of food supply and demand based on a machine learning model according to claim 1, characterized in that: The construction of the Bayesian hierarchical model includes: Step 1: Design a hierarchical structure of social attributes, classify consumer preferences, obtain the prior distribution of each group, and introduce restricted spline functions for variables J with nonlinear effects and high-dimensional complexity; Step 2: Time trend modeling, integrating data from multiple years to build a time series model and identify long-term behavioral changes; Step 3: Dynamic and intelligent adjustment of prior information. The dynamic adjustment of prior information is based on historical data and the latest market trends. Step 4: Model verification and automatic tuning. Based on historical prediction error feedback, the hierarchical structure settings are automatically adjusted, model parameters are dynamically optimized, model performance is evaluated using cross-validation technology, and the model is tuned iteratively multiple times.
7. The intelligent analysis method of the joint evolution of food supply and demand based on a machine learning model according to claim 1 or 6, characterized in that: The Markov chain Monte Carlo sampling includes: Step 1: Design a hybrid sampling strategy based on data characteristics and model complexity. Use Gibbs sampling for conditionally independent variables and an adaptive version of No-U-Turn Sampler for high-dimensional complex variables or restricted variables. Step 2: Multi-chain parallel sampling, dynamic allocation of computing resources, automatic adjustment of the number of chains according to the sampling convergence speed, to ensure the efficient operation of complex Bayesian models; Step 3: Dynamically adjust the sampling step size. Dynamically adjust the MCMC sampling step size according to the changes in parameters during the sampling process. By real-time monitoring of changes in parameter distribution, the sampling process is automatically adjusted to ensure that the sampling efficiency of the model is always in the best state under different data sets and application scenarios. Step 4: Automatic feedback optimization: During the sampling process, the sampling parameters are optimized according to the sampling quality and model error rate, the convergence time is reduced, and the sampling quality is improved.
8. The intelligent analysis method of the joint evolution of food supply and demand based on a machine learning model according to claim 1, characterized in that: The S3 includes comparing the results based on the food production prediction and the food consumption prediction.
9. The intelligent analysis method of the joint evolution of food supply and demand based on a machine learning model according to claim 1, characterized in that: The regional food supply and demand balance assessment includes calculating the food self-sufficiency rate of each region based on regional production and consumption data provided by food production forecasts and food consumption forecasts; The regional food supply and demand stability assessment includes calculating regional food production volatility and regional food consumption volatility indicators based on time series data of food production and food consumption in each region; The sustainability assessment of regional food supply and demand includes predicting future food trade, supply and consumption relationships through a multi-regional input-output model based on regional input-output tables and historical food data, generating a food flow matrix, and using ecological network analysis methods to calculate resilience, redundancy and efficiency indicators.
Citation Information
Patent Citations
Agricultural product supply and demand matching system and method
CN104732435A
Intelligent grain supply and demand management method and system based on big data and medium
CN116894588A
Corn planting precise fertilizer preparation method based on multi-strategy optimization random forest, electronic equipment and storage medium
CN117455066A
Rice yield prediction method and device based on artificial intelligence, equipment and medium
CN118551880A
IoT based smart farming using machine learning
IN202141008351A