A method for analyzing factors influencing food security resilience based on a Bayesian network

By combining the Spearman rank correlation coefficient method, the optimal subset of the R2 maximum criterion, and the feature importance assessment of random forest to screen factors, and using the simulated annealing algorithm to construct a Bayesian network, the factors influencing food security resilience are analyzed through reverse reasoning. This solves the problem of incomplete factor analysis in existing technologies and realizes an in-depth analysis of the multi-factor correlation of food security resilience.

CN121032312BActive Publication Date: 2026-04-14湖南工商大学
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-19
Publication Date
2026-04-14

AI Technical Summary

Technical Problem

Existing technologies are insufficient for a systematic and comprehensive analysis of the various factors influencing food security resilience, especially in terms of the lack of in-depth research on interactions and indirect effects. Traditional methods can only analyze the impact of a few factors and cannot fully reveal the complex relationships of food security resilience.

Method used

Influencing factors were screened using the Spearman rank correlation coefficient method, the adjusted R2 maximum criterion optimal subset, and the random forest feature importance assessment method. Quantitative indicators were transformed using the natural breakpoint method, and a three-layer Bayesian network was constructed using the simulated annealing algorithm. The network structure was evaluated using the Bayesian information criterion, and the influence of factors was analyzed by reverse reasoning using the Bayesian network.

Benefits of technology

It enables precise screening and comprehensive analysis of multidimensional factors contributing to food security resilience, constructs a high-quality Bayesian network, deeply analyzes the direct and indirect impacts of each factor, provides detailed evidence for improving food security resilience, and breaks through the limitations of single-method analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121032312B_ABST
    Figure CN121032312B_ABST
Patent Text Reader

Abstract

The application provides a kind of grain security resilience influence factor analysis method based on Bayesian network.The method relates to the field of grain security.The method comprises the following steps: by Spearman rank correlation coefficient method, adjusted R 2 The maximum criterion optimal subset, random forest feature importance evaluation three kinds of methods are used to screen the influence factors of grain security resilience, and the union method is used to determine the index; the natural break point method is used to convert the quantitative index into three types of qualitative index by minimizing the within-group variance and maximizing the between-group variance; the grain security resilience is used as the dependent variable, and the final index is used as the independent variable; the simulated annealing algorithm is used to construct a three-layer Bayesian network; the Bayesian information criterion scoring function is used to evaluate the iteration to obtain the best structure; based on this, the reverse reasoning method is used to calculate the reverse reasoning probability and change of each index, and the influence effect is analyzed. The application can systematically and comprehensively analyze the influence effect of various factors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of food security technology, and in particular to a method for analyzing the influencing factors of food security resilience based on Bayesian networks. Background Technology

[0002] Food security resilience refers to the ability of food security to cope with risks and shocks, and is a crucial aspect of ensuring food security. It can be categorized into food system resilience, food supply chain resilience, and food production resilience. Exploring the influencing factors of food security resilience is essential for enhancing it and safeguarding national food security. Because the development level of food security resilience is affected by numerous factors, some of which may have a significant direct impact, while others may influence it indirectly, current technologies for exploring these influencing factors largely rely on traditional regression analysis methods. These methods can only analyze the effects of a few factors, and further in-depth research on interactions and indirect effects is needed. A systematic and comprehensive method for analyzing the influencing factors of food security resilience is lacking. Summary of the Invention

[0003] This application provides a method for analyzing the influencing factors of food security resilience based on Bayesian networks, which incorporates multiple influencing factors of food security resilience into the model and systematically and comprehensively analyzes the effects of each factor.

[0004] Firstly, this application provides a method for analyzing factors influencing food security resilience based on Bayesian networks, including:

[0005] Using Spearman's rank correlation coefficient method, adjusted R 2 The maximum criterion optimal subset, random forest feature importance assessment and three other methods were used to screen the influencing factors of food security resilience, and then the influencing factor indicators were determined by the union method.

[0006] Using the natural breakpoint method, by minimizing the within-group variance and maximizing the between-group variance, the quantitative influencing factor indicators in the influencing factor indicators are converted into three categories of qualitative indicators: high, medium, and low, to obtain the final influencing factor indicators.

[0007] Using food security resilience as the dependent variable and the aforementioned final influencing factor index as the independent variable, a three-layer Bayesian network is constructed using the simulated annealing algorithm. The network structure is evaluated using the Bayesian information criterion scoring function, and the optimal network structure is obtained iteratively.

[0008] Based on the optimal network structure, the Bayesian network backward inference method is used to set the probability of the dependent variable food security resilience being high, calculate the backward inference probability and changes of each final influencing factor indicator, and analyze the impact of each final influencing factor indicator.

[0009] In one possible design, the specific implementation steps of the Spearman rank correlation coefficient method include:

[0010] Calculate the Spearman rank correlation coefficients between food security resilience and various influencing factors, and screen out factors with correlation coefficients higher than the critical value of 0.3; the formula for calculating the Spearman rank correlation coefficient is as follows:

[0011]

[0012] Where n is the sample size, d j For corresponding to y and x i The grade difference of the j-th pair of observations, y represents food security resilience, and x i These are influencing factors.

[0013] In one possible design, the adjusted R 2 The specific implementation steps of the maximum criterion for optimal subsets include:

[0014] In multiple linear regression analysis, the adjusted R-value is selected. 2 The subset of independent variables corresponding to the largest value is used as the filtering result; the adjusted R 2 The calculation formula is:

[0015]

[0016] Where n is the sample size, p is the number of independent variables, and R0 is the number of independent variables. 2 The coefficient of determination before adjustment. Let y be the mean of the observed values. j For the observed values, These are the predicted values ​​from multiple linear regression. This is the adjusted complex coefficient of determination.

[0017] In one possible design, the specific implementation steps for evaluating the importance of random forest features include:

[0018] Random forests are used to calculate the feature importance of each influencing factor, and the top few factors in terms of feature importance are selected as the screening results; the formula for calculating the feature importance is:

[0019]

[0020] Where, N trees Let x be the total number of decision trees in the forest, and splits(i) be the number of features x used in all decision trees. i Split nodes, where ΔVar is the decrease in variance after a node split, Importance iLet p represent the feature importance of the i-th influencing factor, and p be the index of the decision tree, where Normal_Importance is the key value. i Let represent the feature importance of the i-th influencing factor after standardization.

[0021] In one possible design, the optimization function of the natural breakpoint method is:

[0022]

[0023] Among them, C i It is the data set of the i-th class, μ i q is the mean of the data in class i, q is the number of classes, and x is the data in the dataset of class i.

[0024] In one possible design, food security resilience is used as the dependent variable, and the final influencing factor index is used as the independent variable. A three-layer Bayesian network is constructed using the simulated annealing algorithm. The network structure is evaluated using the Bayesian information criterion scoring function, and the optimal network structure is obtained iteratively, including:

[0025] Construct a three-layer Bayesian network; wherein the three-layer Bayesian network includes a first layer, a second layer and a third layer, the first layer is used to obtain the dependent variable, the dependent variable being food security resilience; the second layer randomly selects 3-5 independent variables to directly point to the dependent variable, and the third layer is used to make the remaining independent variables point to the independent variables of the second layer, and allows connections between the remaining independent variables and the independent variables of the second layer, but there cannot be self-loops;

[0026] Initialize the simulated annealing parameters; wherein, the simulated annealing parameters include the maximum number of iterations, the initialization temperature, and the cooling rate;

[0027] Based on the initialized simulated annealing parameters, the network structure of the three-layer Bayesian network is randomly initialized. A small perturbation is applied to the current network structure by adding, deleting, or reversing an edge. The network structure is evaluated using the Bayesian information criterion scoring function. The decision to accept the new structure is based on the score change and the temperature. If the score increases, it is accepted; if the score decreases, a worse solution is accepted with a set probability. The temperature is gradually decreased to reduce the probability of accepting worse solutions until the score no longer increases. The final Bayesian network constructed by the simulated annealing algorithm is the optimal network structure. The Bayesian information criterion scoring function is:

[0028] BIC = ln(n)·k-2·ln(L)

[0029] Where BIC is the score, n is the number of samples, k is the number of parameters in the model, and L is the likelihood value of the model.

[0030] In one possible design, based on the optimal network structure, using the Bayesian network backward inference method, the probability of the dependent variable "food security resilience" being high is set, the backward inference probability and changes of each final influencing factor indicator are calculated, and the impact of each final influencing factor indicator is analyzed, including:

[0031] The Bayesian network backward inference method calculates the posterior probability of an event to infer the cause from the result. The formula for calculating the posterior probability is as follows:

[0032]

[0033] Where P(X|Y) is the posterior probability of the independent variable X given that the dependent variable Y is known, i.e. the effect of the factor; P(Y|X) is the likelihood function, i.e. the probability of observing the dependent variable Y given that the independent variable X is true; P(X) is the prior probability of the independent variable X; and P(Y) is the marginal probability of the dependent variable Y, calculated using the law of total probability.

[0034] The method for analyzing the effects is as follows: compare the probability of backward reasoning with the probability of forward reasoning. If the probability of a certain factor being high increases, then the factor is determined to have a positive promoting effect; if the probability of a certain factor being low increases, then the factor is determined to have a negative inhibiting effect.

[0035] Secondly, this application provides a device for analyzing factors affecting food security resilience based on Bayesian networks, the device comprising:

[0036] The influencing factor screening module is configured to use the Spearman rank correlation coefficient method and adjusted R0. 2 The maximum criterion optimal subset, random forest feature importance assessment and three other methods were used to screen the influencing factors of food security resilience, and then the influencing factor indicators were determined by the union method.

[0037] The indicator conversion module is configured to use the natural breakpoint method to convert the quantitative influencing factor indicators in the influencing factor indicators into three categories of qualitative indicators: high, medium, and low, by minimizing the within-group variance and maximizing the between-group variance, so as to obtain the final influencing factor indicators.

[0038] The network construction module is configured to use food security resilience as the dependent variable and the final influencing factor index as the independent variable, construct a three-layer Bayesian network using the simulated annealing algorithm, evaluate the network structure through the Bayesian information criterion scoring function, and iteratively obtain the optimal network structure.

[0039] The effect analysis module is configured to, based on the optimal network structure, use the Bayesian network backward inference method to set the probability of the dependent variable food security resilience being high, calculate the backward inference probability and changes of each final influencing factor indicator, and analyze the impact effect of each final influencing factor indicator.

[0040] Thirdly, embodiments of this application provide an electronic device, including: at least one processor and a memory; the memory stores computer execution instructions; the at least one processor executes the computer execution instructions stored in the memory, causing the at least one processor to perform the method for analyzing the influencing factors of food security resilience based on Bayesian networks as described in the first aspect and various possible designs of the first aspect.

[0041] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions. When a processor executes the computer-executable instructions, it implements the method for analyzing factors affecting food security resilience based on Bayesian networks as described in the first aspect and various possible designs of the first aspect.

[0042] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the method for analyzing factors affecting food security resilience based on Bayesian networks as described in the first aspect and various possible designs of the first aspect.

[0043] The method for analyzing factors influencing food security resilience based on Bayesian networks provided in this application has at least the following beneficial effects:

[0044] 1. Precise and comprehensive analysis: Feature selection is performed by coupling three methods: Spearman's rank correlation coefficient method, adjusted maximum criterion optimal subset, and random forest feature importance assessment. The union method is used to determine the influencing factors for constructing the Bayesian network. This can more accurately and comprehensively screen out multidimensional factors that have an important impact on food security resilience, avoiding the omission of key factors that may be caused by a single method, and laying a solid foundation for subsequent in-depth analysis.

[0045] 2. Efficient and accurate network construction: Bayesian networks are constructed using simulated annealing algorithm and BIC scoring. Simulated annealing algorithm can effectively escape local optima and has excellent global search capabilities. Combined with BIC scoring, the quality of network structure can be accurately evaluated, thereby constructing high-quality Bayesian networks. This more accurately reveals the complex relationships among various influencing factors of food security resilience and provides strong support for in-depth exploration of the path to improve food security resilience.

[0046] 3. In-depth and comprehensive impact analysis: By using Bayesian network reverse reasoning to deduce causes from results, we can deeply analyze the direct and indirect impact paths and intensity of various factors on food security resilience, uncover the key impact chains hidden in complex relationships, provide detailed evidence for formulating targeted strategies to enhance food security resilience, change the limitation of previous studies that could only analyze the relationship between a few elements, and achieve a comprehensive impact analysis under a complex network of multiple factors. Attached Figure Description

[0047] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0048] Figure 1 A flowchart illustrating a method for analyzing factors influencing food security resilience based on Bayesian networks, provided for embodiments of this application;

[0049] Figure 2 A graph showing the change of BIC score with the number of iterations during simulated annealing provided in this application embodiment;

[0050] Figure 3 A schematic diagram of the structure of the constructed Bayesian network provided in the embodiments of this application;

[0051] Figure 4 A schematic diagram of the reverse reasoning process and results of food security resilience based on Bayesian networks provided in the embodiments of this application;

[0052] Figure 5 A structural diagram of the device for analyzing factors affecting food security resilience based on Bayesian networks provided in this application embodiment.

[0053] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation

[0054] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0055] The collection, storage, use, processing, transmission, provision, and disclosure of financial data or user data involved in the technical solution of this application all comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0056] It should be noted that in the embodiments of this application, certain software, components, models and other existing solutions in the industry may be mentioned. These should be regarded as exemplary and are only intended to illustrate the feasibility of implementing the technical solution of this application. However, it does not mean that the applicant has used or necessarily used the solution.

[0057] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0058] This application provides a method for analyzing factors influencing food security resilience based on Bayesian networks, such as... Figure 1 The diagram shows a flowchart of a method for analyzing factors affecting food security resilience based on Bayesian networks, as provided in an embodiment of this application. The method includes the following steps S10-S40.

[0059] S10. Factor Screening: Factors influencing food security resilience were screened using the Spearman rank correlation coefficient method and adjusted R0. 2 Three methods—maximum criterion optimal subset, random forest feature importance assessment—were used to screen the influencing factors of food security resilience, and then the union method was used to determine the influencing factor indicators.

[0060] In this embodiment, factor screening is achieved through step S10. Specifically, a food security resilience index system is established, and the entropy weight method is used to calculate and select the influencing factors of food security resilience. The influencing factors of food security resilience include multiple aspects, some of which may not have a significant impact; therefore, feature selection is necessary. This invention employs the Spearman rank correlation coefficient method and an adjusted R... 2 Three methods—maximum criterion optimal subset, random forest feature importance assessment—were used to screen the influencing factors of food security resilience. Then, the union method was used to construct a Bayesian network using the factors selected by the three methods.

[0061] In some embodiments, the specific implementation steps for screening the influencing factors of food security resilience using the Spearman rank correlation coefficient method include:

[0062] Calculate the Spearman rank correlation coefficients between food security resilience and various influencing factors, set a critical value, and screen factors that are higher than the critical value of 0.3.

[0063] The Spearman rank correlation coefficient function is expressed as follows:

[0064]

[0065] Where n is the sample size, d j For corresponding to y and x i The grade difference of the j-th pair of observations, y represents food security resilience, and x i These are influencing factors.

[0066] In some embodiments, the adjusted R is used 2 The specific implementation steps for screening the influencing factors of food security resilience using the maximum criterion optimal subset include:

[0067] According to the adjusted R 2 Using the maximization criterion, the optimal subset is found in multiple linear regression analysis, where the degrees of freedom are adjusted for the multiple coefficient of determination (i.e., the adjusted R²). 2 The larger the R², the better the model's performance. 2 The largest corresponding subset is the optimal subset for multiple linear regression analysis.

[0068] Adjusted R 2 The function is:

[0069]

[0070] Where n is the sample size, p is the number of independent variables, and R0 is the number of independent variables. 2 The coefficient of determination before adjustment. Let y be the mean of the observed values. j For the observed values, These are the predicted values ​​from multiple linear regression. This is the adjusted complex coefficient of determination.

[0071] In some embodiments, the specific implementation steps for screening factors influencing food security resilience using random forest feature importance assessment include:

[0072] We used random forest to calculate feature importance and selected the 10 most important factors as the factor selection results.

[0073] The feature importance function in random forest is expressed as:

[0074]

[0075] Where, N trees Let x be the total number of decision trees in the forest, and splits(i) be the number of features x used in all decision trees. iThe split node, ΔVar is the reduction in variance after the node split, and p is the index of the decision tree. Then, the feature importance score is normalized to obtain the standardized feature importance:

[0076]

[0077] Among them, Importance i Normal_Importance represents the feature importance of the i-th influencing factor. i Let represent the feature importance of the i-th influencing factor after standardization.

[0078] S20. Indicator Transformation: Using the natural breakpoint method to minimize within-group variance and maximize between-group variance, quantitative indicators are transformed into qualitative indicators (High Low, Medium Middle, Low High).

[0079] The data on food security resilience and influencing factors are mostly quantitative. The Jenks Natural Breaks Optimization (NBER) method was used to transform these quantitative indicators into qualitative ones. Based on cluster analysis, the NBER method divides the data into three categories (Low, Middle, and High) by minimizing within-group variance and maximizing between-group variance.

[0080] In some embodiments, the objective function of the natural breakpoint method is expressed as:

[0081]

[0082] Among them, C i It is the data set of the i-th class, μ i q is the mean of the data in the i-th class, and q is the number of classes.

[0083] S30. Constructing a Bayesian network: Using food security resilience as the dependent variable, select influencing factors as independent variables, construct a three-layer Bayesian network using the simulated annealing algorithm, evaluate the network structure using the Bayesian Information Criterion (BIC) scoring function, and iterate to obtain the optimal network structure.

[0084] Bayesian networks are probabilistic graphical models that can represent conditional probabilistic relationships between variables and thereby explore the driving factors of food production resilience. Simulated annealing is a heuristic optimization algorithm that can effectively avoid local optima and is suitable for structure learning of Bayesian networks. In simulated annealing, a high initial temperature is set to allow the algorithm to explore extensively in the early stages, and then the temperature is gradually decreased to allow the algorithm to gradually converge to a better solution.

[0085] In some embodiments, step S30 specifically includes the following steps S301-S302.

[0086] S301: Construct a Bayesian network structure.

[0087] Construct a three-layer Bayesian network structure where:

[0088] First layer: Dependent variable y (food security resilience);

[0089] Second layer: Randomly select 3-5 independent variables to directly point to y;

[0090] Third level: The remaining independent variables point to the variables of the second level. The third level allows connections between variables of the second level, but cannot have self-loops.

[0091] S302: Simulated annealing process.

[0092] Simulated annealing parameter settings initialization, including:

[0093] Maximum number of iterations: max_iterations = 5000;

[0094] Initial temperature: initial_temperature = 1000;

[0095] Cooling rate: cooling_rate = 0.95.

[0096] The network structure is randomly initialized, and a small perturbation is applied by adding, deleting, or reversing an edge. The Bayesian Information Criterion (BIC) scoring function is used to evaluate the network structure, and the decision to accept the new structure is based on the changes in the score and the temperature. If the score increases, the solution is accepted; if the score decreases, a worse solution is accepted with a certain probability. The temperature is gradually decreased to reduce the probability of accepting worse solutions until the BIC score no longer increases. The iterative process is as follows: Figure 2 As shown, the final Bayesian network constructed by the simulated annealing algorithm is obtained, which is the Bayesian network with the highest BIC score.

[0097] The Bayesian Information Criterion (BIC) scoring function is as follows:

[0098] BIC = ln(n)·k-2·ln(L)

[0099] Where n is the number of samples, k is the number of parameters in the model, and L is the likelihood value of the model.

[0100] like Figure 3 The diagram shows the Bayesian network constructed in this embodiment, used to analyze and infer the influencing factors of food security resilience. The network contains multiple layers of nodes, and the proportion of each node and its corresponding category is as follows:

[0101] The target nodes include: food security resilience (High 31%, Middle 35%, Low 34%).

[0102] The fundamental factors include: average temperature (High 44%, Middle 32%, Low 24%), net application rate of agricultural fertilizers (High 19%, Middle 59%, Low 22%), total water resources (High 16%, Middle 23%, Low 60%), fiscal expenditure on agriculture, forestry and water affairs (High 28%, Middle 44%, Low 27%), and per capita disposable income of rural residents (High 22%, Middle 32%, Low 47%).

[0103] Derivative factor nodes include: sunshine duration (High 40%, Middle 50%, Low 10%), wind speed (High 22%, Middle 57%, Low 21%), number of air pollutants (High 20%, Middle 48%, Low 32%), fiscal expenditure on culture, sports and media (High 20%, Middle 34%, Low 46%), and number of agricultural meteorological observation stations (High 21%, Middle 32%, Low 47%). Rainfall (High 26%, Middle 36%, Low 38%), Rural Consumer Price Index (High 25%, Middle 50%, Low 25%), Social Security and Employment Fiscal Expenditure (High 20%, Middle 36%, Low 44%), Science and Technology Fiscal Expenditure (High 20%, Middle 30%, Low 50%), and Healthcare Fiscal Expenditure (High 22%, Middle 32%, Low 47%).

[0104] It should be noted that the basic factor nodes, intermediate related nodes, and derived factor nodes are the influencing factor indicators determined in step S10, and their corresponding High, Middle, and Low values ​​can be calculated in step S20. All nodes are connected by directed edges to form a complete Bayesian network, enabling reasoning analysis from basic factors to food security resilience. Based on the state probabilities of each node, forward or backward reasoning can be performed using Bayes' theorem to assist in exploring the patterns of how food security resilience is influenced by multiple factors.

[0105] S40. Reverse Reasoning: Using the Bayesian network reverse reasoning method, by setting the probability of the dependent variable food security resilience to "High", the reverse reasoning probability and changes of each influencing factor are calculated, and the influence effect of each factor is analyzed.

[0106] Bayesian network backward inference is a process of inferring causes from effects by calculating the posterior probability of events. Backward inference is based on Bayes' theorem:

[0107]

[0108] Where P(X|Y) is the posterior probability of the independent variable X given that the dependent variable Y is known, i.e., the effect of the factor; P(Y|X) is the likelihood function, i.e., the probability of observing the dependent variable Y given that the independent variable X is true; P(X) is the prior probability of the independent variable X; and P(Y) is the marginal probability of the dependent variable Y, which can be expressed by the law of total probability. calculate.

[0109] Food security management aims to enhance food security resilience, that is, to maximize the probability of food security resilience reaching a "High" level. Setting the probability of "High" resilience at 100%, the probability of each influencing factor is calculated using Bayes' theorem, resulting in a reverse inference probability, such as... Figure 4 As shown, by comparing the probabilities of reverse reasoning with those of forward reasoning, if the probability of a factor being "High" increases, it indicates a positive promoting effect; if the probability of being "Low" increases, it indicates a negative inhibiting effect.

[0110] Specifically Figure 4 This paper presents the reverse reasoning process and results for food security resilience based on Bayesian networks. The constructed Bayesian network contains multiple layers of nodes, and the initial proportions of each node and its corresponding category are as follows:

[0111] Target nodes include: food security resilience (High 100%, Middle 0%, Low 0%).

[0112] The fundamental factors include: average temperature (High 43%, Middle 33%, Low 25%), net application rate of agricultural fertilizers (High 22%, Middle 56%, Low 22%), total water resources (High 15%, Middle 23%, Low 62%), fiscal expenditure on agriculture, forestry and water affairs (High 30%, Middle 42%, Low 28%), and per capita disposable income of rural residents (High 21%, Middle 29%, Low 50%).

[0113] Derivative factor nodes include: sunshine duration (High 46%, Middle 25%, Low 29%), wind speed (High 22%, Middle 57%, Low 21%), number of air pollutants (High 22%, Middle 47%, Low 31%), fiscal expenditure on culture, sports and media (High 20%, Middle 33%, Low 46%), and number of agricultural meteorological observation stations (High 21%, Middle 32%, Low 47%). Rainfall (High 25%, Middle 36%, Low 39%), Rural Consumer Price Index (High 25%, Middle 50%, Low 25%), Social Security and Employment Fiscal Expenditure (High 21%, Middle 35%, Low 44%), Science and Technology Fiscal Expenditure (High 20%, Middle 30%, Low 51%), and Healthcare Fiscal Expenditure (High 20%, Middle 42%, Low 38%).

[0114] By setting the probability of food security resilience of the target node as High (31%), Middle (29%), and Low (42%), the reverse inference method of Bayesian network is used to calculate the reverse inference probability and changes of each basic and intermediate factor node. This presents the effect of each influencing factor on food security resilience under the target state, and helps to analyze the correlation logic between multiple factors and food security resilience.

[0115] This application also provides a device for analyzing factors affecting food security resilience based on Bayesian networks, such as... Figure 5 As shown, the device for analyzing factors affecting food security resilience based on Bayesian networks includes:

[0116] The influencing factor screening module 501 is configured to use the Spearman rank correlation coefficient method and adjusted R. 2 The maximum criterion optimal subset, random forest feature importance assessment and three other methods were used to screen the influencing factors of food security resilience, and then the influencing factor indicators were determined by the union method.

[0117] The indicator conversion module 502 is configured to use the natural breakpoint method to convert the quantitative influencing factor indicators in the influencing factor indicators into three categories of qualitative indicators: high, medium, and low, by minimizing the within-group variance and maximizing the between-group variance, so as to obtain the final influencing factor indicators.

[0118] The network construction module 503 is configured to use food security resilience as the dependent variable and the final influencing factor index as the independent variable, construct a three-layer Bayesian network using the simulated annealing algorithm, evaluate the network structure through the Bayesian information criterion scoring function, and iteratively obtain the optimal network structure.

[0119] The effect analysis module 504 is configured to, based on the optimal network structure, use the Bayesian network backward inference method to set the probability of the dependent variable food security resilience being high, calculate the backward inference probability and changes of each final influencing factor indicator, and analyze the impact effect of each final influencing factor indicator.

[0120] This application provides an electronic device. The electronic device may include a processor and a memory, wherein the processor and the memory can communicate; exemplarily, the processor and the memory communicate via a communication bus.

[0121] The processor executes computer execution instructions stored in memory, causing the processor to perform the scheme in the above embodiments. The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0122] The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The system bus can be divided into address bus, data bus, control bus, etc. Transceivers are used to enable communication between database access devices and other computers (e.g., clients, read-write libraries, and read-only libraries). Memory may include random access memory (RAM) and may also include non-volatile memory.

[0123] The electronic device provided in this application embodiment can be the terminal device described in the above embodiments.

[0124] This application also provides a computer-readable storage medium storing computer instructions. When the computer instructions are executed on a computer, the computer performs the technical solution of the method for analyzing the influencing factors of food security resilience based on Bayesian networks described in the above embodiments.

[0125] This application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When the at least one processor executes the computer program, it can implement the technical solution of the method for analyzing the influencing factors of food security resilience based on Bayesian networks in the above embodiments.

[0126] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or modules, and may be electrical, mechanical, or other forms.

[0127] The modules described as separate components may or may not be physically separate. The components shown as modules may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to implement the solution of this embodiment according to actual needs.

[0128] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing unit, or each module can exist physically separately, or two or more modules can be integrated into one unit. The unit composed of the above modules can be implemented in hardware or in the form of hardware plus software functional units.

[0129] The integrated modules described above, implemented as software functional modules, can be stored in a computer-readable storage medium. These software functional modules, stored in a storage medium, include several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute some steps of the methods of the various embodiments of this application.

[0130] It should be understood that the aforementioned processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in this invention can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.

[0131] The memory may include high-speed RAM, and may also include non-volatile storage (NVM), such as at least one disk storage device, and may also be a USB flash drive, external hard drive, read-only memory, disk or optical disc, etc.

[0132] Buses can be Industry Standard Architecture (ISA) buses, Peripheral Component Interconnect (PCI) buses, or Extended Industry Standard Architecture (EISA) buses, etc. Buses can be categorized into address buses, data buses, control buses, etc.

[0133] The aforementioned storage medium can be implemented from 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 read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk. The storage medium can be any available medium accessible to general-purpose or special-purpose computers.

[0134] An exemplary storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Alternatively, the storage medium can be an integral part of the processor. The processor and storage medium can reside in an Application Specific Integrated Circuit (ASIC). Alternatively, the processor and storage medium can exist as discrete components in an electronic control unit or main control device.

[0135] Those skilled in the art will understand that all or part of the steps of the above-described method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When executed, the program performs the steps of the above-described method embodiments; and the aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.

[0136] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application.

Claims

1. A method for analyzing factors influencing food security resilience based on Bayesian networks, characterized in that, The method includes: Using Spearman's rank correlation coefficient method, adjusted R 2 The maximum criterion optimal subset, random forest feature importance assessment, and three other methods were used to screen the influencing factors of food security resilience, and then the influencing factor indicators were determined by the union method. Using the natural breakpoint method, by minimizing the within-group variance and maximizing the between-group variance, the quantitative influencing factor indicators in the influencing factor indicators are converted into three categories of qualitative indicators: high, medium, and low, to obtain the final influencing factor indicators. Using food security resilience as the dependent variable and the aforementioned final influencing factor indicators as independent variables, a three-layer Bayesian network is constructed using the simulated annealing algorithm. The network structure is evaluated using the Bayesian information criterion scoring function, and the optimal network structure is obtained iteratively. This three-layer Bayesian network contains multiple layers of nodes, specifically including target nodes, basic factor nodes, and derived factor nodes. The target node includes food security resilience. The basic factor nodes include: average temperature, net amount of agricultural fertilizer application, total water resources, fiscal expenditure on agriculture, forestry and water affairs, and per capita disposable income of rural residents. The derived factor nodes include: sunshine duration, wind speed, number of air pollutants, fiscal expenditure on culture, sports and media, number of agricultural meteorological observation stations, precipitation, rural residents' consumer price index, fiscal expenditure on social security and employment, fiscal expenditure on science and technology, and fiscal expenditure on medical and health care. Based on the optimal network structure, the Bayesian network backward inference method is used to set the probability of the dependent variable food security resilience being high, calculate the backward inference probability and changes of each final influencing factor indicator, and analyze the impact of each final influencing factor indicator. Using food security resilience as the dependent variable and the aforementioned final influencing factor indicators as independent variables, a three-layer Bayesian network is constructed using the simulated annealing algorithm. The network structure is evaluated using the Bayesian information criterion scoring function, and the optimal network structure is obtained iteratively, including: Construct a three-layer Bayesian network; wherein the three-layer Bayesian network includes a first layer, a second layer and a third layer, the first layer is used to obtain the dependent variable, the dependent variable being food security resilience; the second layer randomly selects 3-5 independent variables to directly point to the dependent variable, and the third layer is used to make the remaining independent variables point to the independent variables of the second layer, and allows connections between the remaining independent variables and the independent variables of the second layer, but there cannot be self-loops; Initialize the simulated annealing parameters; wherein, the simulated annealing parameters include the maximum number of iterations, the initialization temperature, and the cooling rate; Based on the initialized simulated annealing parameters, the network structure of the three-layer Bayesian network is randomly initialized. A small perturbation is applied to the current network structure by adding, deleting, or reversing an edge. The network structure is evaluated using the Bayesian information criterion scoring function. The decision to accept the new structure is based on the score change and the temperature. If the score increases, it is accepted; if the score decreases, a worse solution is accepted with a set probability. The temperature is gradually decreased to reduce the probability of accepting worse solutions until the score no longer increases. The final Bayesian network constructed by the simulated annealing algorithm is the optimal network structure. The Bayesian information criterion scoring function is: in, BIC As a rating value, n It is the sample size. k It refers to the number of parameters in the model. L It is the likelihood value of the model; Based on the optimal network structure, using the Bayesian network backward inference method, the probability of the dependent variable "food security resilience" being high is set, and the backward inference probability and changes of each final influencing factor indicator are calculated. The impact of each final influencing factor indicator is analyzed, including: The Bayesian network backward inference method calculates the posterior probability of an event to infer the cause from the result. The formula for calculating the posterior probability is as follows: in It is the dependent variable Y Independent variable under known conditions X The posterior probability, i.e., the effect of the factor. It is the likelihood function, i.e., the independent variable. X The dependent variable observed under the condition that it holds true Y The probability, It is the independent variable X The prior probability, It is the dependent variable Y The marginal probability is calculated using the law of total probability. The method for analyzing the effects is as follows: compare the probability of backward reasoning with the probability of forward reasoning. If the probability of a certain factor being high increases, then the factor is determined to have a positive promoting effect; if the probability of a certain factor being low increases, then the factor is determined to have a negative inhibiting effect.

2. The method for analyzing factors affecting food security resilience based on Bayesian networks according to claim 1, characterized in that, The specific implementation steps of the Spearman rank correlation coefficient method include: Calculate the Spearman rank correlation coefficients between food security resilience and various influencing factors, and screen out factors with correlation coefficients higher than the critical value of 0.3; the formula for calculating the Spearman rank correlation coefficient is as follows: in, n For sample size, d j For corresponding y and x i No. j For the grade difference of the observations, y To ensure food security resilience, x i These are influencing factors.

3. The method for analyzing factors affecting food security resilience based on Bayesian networks according to claim 1, characterized in that, The adjusted R 2 The specific implementation steps of the maximum criterion for optimal subsets include: In multiple linear regression analysis, the adjusted values ​​are selected. R 2 The subset of independent variables corresponding to the largest value is used as the filtering result; the adjusted R 2 The calculation formula is: in, For sample size, The number of independent variables. The coefficient of determination before adjustment. The mean of the observed values, For the observed values, These are the predicted values ​​from multiple linear regression. This is the adjusted complex coefficient of determination.

4. The method for analyzing factors affecting food security resilience based on Bayesian networks according to claim 1, characterized in that, The specific implementation steps for assessing the importance of random forest features include: Random forests are used to calculate the feature importance of each influencing factor, and the top few factors in terms of feature importance are selected as the screening results; the formula for calculating the feature importance is: in, The total number of decision trees in the forest. Use features in all decision trees Split nodes, This represents the reduction in variance after node splitting. Importance i For the first i The characteristic importance of each influencing factor p For the index of the decision tree, For the first i The importance of features after standardization of each influencing factor.

5. The method for analyzing factors affecting food security resilience based on Bayesian networks according to claim 1, characterized in that, The optimization function of the natural breakpoint method is: in, C i It is the first i Data collections of classes It is the first i The mean of the data for each class, where q is the number of classes. x It is the first i Data in a class's data collection.

6. A device for analyzing factors affecting food security resilience based on Bayesian networks, characterized in that, The device includes: The influencing factor screening module is configured to use the Spearman rank correlation coefficient method and adjusted... R 2 The maximum criterion optimal subset, random forest feature importance assessment, and three other methods were used to screen the influencing factors of food security resilience, and then the influencing factor indicators were determined by the union method. The indicator conversion module is configured to use the natural breakpoint method to convert the quantitative influencing factor indicators in the influencing factor indicators into three categories of qualitative indicators: high, medium, and low, by minimizing the within-group variance and maximizing the between-group variance, so as to obtain the final influencing factor indicators. The network construction module is configured to use food security resilience as the dependent variable and the final influencing factor indicators as independent variables. It constructs a three-layer Bayesian network using a simulated annealing algorithm, evaluates the network structure using the Bayesian information criterion scoring function, and iteratively obtains the optimal network structure. This three-layer Bayesian network contains multiple layers of nodes, specifically including target nodes, basic factor nodes, and derived factor nodes. The target node includes food security resilience. The basic factor nodes include: average temperature, net conversion of agricultural fertilizer application, total water resources, fiscal expenditure on agriculture, forestry, and water affairs, and per capita disposable income of rural residents. The derived factor nodes include: sunshine duration, wind speed, number of air pollutants, fiscal expenditure on culture, sports, and media, number of agricultural meteorological observation stations, precipitation, rural residents' consumer price index, fiscal expenditure on social security and employment, fiscal expenditure on science and technology, and fiscal expenditure on medical and health care. The network construction module is further configured as follows: Construct a three-layer Bayesian network; wherein the three-layer Bayesian network includes a first layer, a second layer and a third layer, the first layer is used to obtain the dependent variable, the dependent variable being food security resilience; the second layer randomly selects 3-5 independent variables to directly point to the dependent variable, and the third layer is used to make the remaining independent variables point to the independent variables of the second layer, and allows connections between the remaining independent variables and the independent variables of the second layer, but there cannot be self-loops; Initialize the simulated annealing parameters; wherein, the simulated annealing parameters include the maximum number of iterations, the initialization temperature, and the cooling rate; Based on the initialized simulated annealing parameters, the network structure of the three-layer Bayesian network is randomly initialized. A small perturbation is applied to the current network structure by adding, deleting, or reversing an edge. The network structure is evaluated using the Bayesian information criterion scoring function. The decision to accept the new structure is based on the score change and the temperature. If the score increases, it is accepted; if the score decreases, a worse solution is accepted with a set probability. The temperature is gradually decreased to reduce the probability of accepting worse solutions until the score no longer increases. The final Bayesian network constructed by the simulated annealing algorithm is the optimal network structure. The Bayesian information criterion scoring function is: in, BIC As a rating value, n It is the sample size. k It refers to the number of parameters in the model. L It is the likelihood value of the model; The effect analysis module is configured to, based on the optimal network structure, utilize Bayesian network backward inference to set the probability of the dependent variable, food security resilience, being high, calculate the backward inference probability and changes of each final influencing factor indicator, and analyze the impact of each final influencing factor indicator, including: The Bayesian network backward inference method calculates the posterior probability of an event to infer the cause from the result. The formula for calculating the posterior probability is as follows: in It is the dependent variable Y Independent variable under known conditions X The posterior probability, i.e., the effect of the factor. It is the likelihood function, i.e., the independent variable. X The dependent variable observed under the condition that it holds true Y The probability, It is the independent variable X The prior probability, It is the dependent variable Y The marginal probability is calculated using the law of total probability. The method for analyzing the effects is as follows: compare the probability of backward reasoning with the probability of forward reasoning. If the probability of a certain factor being high increases, then the factor is determined to have a positive promoting effect; if the probability of a certain factor being low increases, then the factor is determined to have a negative inhibiting effect.

7. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes the computer execution instructions stored in the memory to implement the method for analyzing the influencing factors of food security resilience based on Bayesian networks as described in any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method for analyzing factors affecting food security resilience based on Bayesian networks as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Method for evaluating fire-resistant toughness of highway tunnel

    CN118195133A

  • Subway tunnel construction induced adjacent building damage prediction model construction method based on Bayesian network

    CN118627174A