Peanut yield prediction method, device, equipment and medium
By combining decomposition models and multinomial regression with principal component analysis and stacked models, the problem of low accuracy in peanut yield prediction in existing technologies has been solved, achieving accurate prediction of peanut yield and extending to yield prediction of other crops.
Patent Information
- Application Number
- CN202410996208.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-24
- Publication Date
- 2024-11-15
AI Technical Summary
In existing technologies, a single machine learning model or parameter function is insufficient to fully capture the complex nonlinear relationship between peanut yield and meteorological factors, resulting in reduced prediction accuracy.
A trend-based output prediction model is constructed using decomposition modeling and multinomial regression modeling. A fluctuating output prediction model is constructed by combining principal component analysis and stacked modeling. The advantages of integrating different base learners through multinomial regression and stacked modeling are utilized to improve the robustness of the model to data noise and outliers.
It significantly improves the accuracy of peanut yield forecasting, accurately grasps long-term trends, and enhances the ability to handle data noise and outliers. It is applicable to peanut yield forecasting and yield forecasting of other crops.
Smart Images

Figure CN118966822A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of agricultural production, and in particular to a peanut yield prediction method, a corresponding device, an electronic device and a computer-readable storage medium. Background Art
[0002] Agricultural production is closely related to meteorological conditions. When crop varieties, soil fertility and agricultural production management levels are relatively stable, meteorological conditions are the key factors affecting changes in crop yields. Among them, changes in meteorological factors such as temperature, precipitation and sunshine time are closely related to crop growth and are the main uncontrollable factors affecting crop yields. Peanuts are a crop with high nutritional value and a major oil crop, widely grown in Asia, Africa and the Americas.
[0003] In recent years, with the increasing severity of climate change, more and more studies have begun to focus on the impact of meteorological changes on the yield of crops such as peanuts. At present, many studies have focused on the impact of meteorological changes on the yield of crops such as peanuts, but for complex multivariate regression problems, most of the studies focus on using a single machine learning model such as K nearest neighbor, support vector machine and random forest to predict crop yield, or use parameter functions to simulate the response of crop yield to input variables to predict crop yield. It is difficult to fully capture the complex nonlinear relationship between crop yield and meteorological factors, which may reduce the prediction accuracy of peanut yield.
[0004] To sum up, adapting a single machine learning model in the existing technology to predict crop yield, or using parameter functions to simulate the response of crop yield to input variables to predict crop yield, is difficult to fully capture the complex nonlinear relationship between crop yield and meteorological factors, which may reduce the prediction accuracy of peanut yield. The applicant has made corresponding explorations to solve this problem. Summary of the invention
[0005] The purpose of this application is to solve the above-mentioned problems and provide a peanut yield prediction method, corresponding device, electronic device and computer-readable storage medium.
[0006] In order to meet the various objectives of this application, this application adopts the following technical solutions:
[0007] A peanut yield prediction method proposed to meet one of the purposes of this application includes:
[0008] In response to the peanut yield forecast instruction, the historical meteorological data of peanuts in the target area during the growth and development stage and the corresponding historical annual yield are obtained;
[0009] The decomposition model method is used to decompose the historical annual yield to determine the trend yield and fluctuation yield of peanuts, and a peanut trend yield prediction model is constructed according to the trend yield and fluctuation yield through a polynomial regression model, and the historical annual fluctuation yield related to meteorological data is calculated, wherein the historical annual fluctuation yield represents the annual production change of peanuts in the target area;
[0010] The historical meteorological data are subjected to principal component analysis by using the principal component analysis method to determine the principal component meteorological features corresponding to the cumulative variance contribution exceeding the preset percentage in the historical meteorological data, and the preset stacking model is trained based on the principal component meteorological features corresponding to the cumulative variance contribution exceeding the preset percentage and the historical annual fluctuation yield to construct a peanut fluctuation yield prediction model;
[0011] Based on the peanut trend yield prediction model and the peanut fluctuation yield prediction model, the peanut yield of the year is determined according to the meteorological data of the peanuts in the target area during the growth and development stage to complete the prediction of the peanut yield.
[0012] Optionally, the steps of using a decomposition model method to decompose the historical annual yield to determine the trend yield and fluctuating yield of peanuts, and constructing a peanut trend yield prediction model according to the trend yield and fluctuating yield through a polynomial regression model include:
[0013] Performing data preprocessing on the historical annual output to determine the time series data corresponding to the historical annual output;
[0014] Decomposing the historical annual yield based on a preset decomposition model method, using a moving average algorithm or an exponential smoothing algorithm in the decomposition model method to capture long-term trend changes to determine the trend yield of peanuts, and using a seasonal decomposition algorithm in the decomposition model method to determine the fluctuation yield of peanuts;
[0015] A peanut trend yield prediction model is constructed based on the trend yield and fluctuating yield through a polynomial regression model, and the historical annual fluctuating yield related to meteorological data is calculated.
[0016] Optionally, the historical annual yield is decomposed based on a decomposition model method to determine the trend yield, fluctuating yield and random yield of peanuts in the target area, and the expression is:
[0017] y e =x t +x f +e,
[0018] Among them, y e To predict the output, x t is the trend output, x fis the fluctuating yield, e is the random yield, the trend yield represents the long-term trend of peanut yield, the fluctuating yield represents the seasonal or interannual variation of crop yield, and the random yield represents the yield part caused by pests and diseases and natural disasters.
[0019] Optionally, the polynomial regression model is expressed as:
[0020] y=β0+β1x+β2x 2 +…+β n x n +∈,
[0021] Among them, y represents the trend output, x represents time, and β n are the coefficients of the polynomial and ∈ is the random error.
[0022] Optionally, the step of performing principal component analysis on the historical meteorological data using a principal component analysis method to determine the principal component meteorological features corresponding to the cumulative variance contribution in the historical meteorological data exceeding a preset percentage includes:
[0023] Acquire historical meteorological data, calculate and determine the difference between the historical meteorological data and the mean of the historical meteorological data, and determine the ratio between the difference and the standard deviation of the historical meteorological data, so as to perform standardization processing on the historical meteorological data;
[0024] Calculate and determine the covariance matrix between the historical meteorological data, perform eigenvalue decomposition on the covariance matrix, and obtain eigenvalues and their corresponding eigenvectors;
[0025] Arrange the eigenvalues from large to small, and select the principal component meteorological features corresponding to the eigenvalues with the highest rankings;
[0026] The variance contribution of each principal component meteorological feature is calculated, and the cumulative variance contribution is calculated, and the principal component meteorological feature corresponding to the cumulative variance contribution exceeding a preset percentage in the historical meteorological data is determined as the final principal component meteorological feature.
[0027] Optionally, the steps of constructing a peanut fluctuation yield prediction model include:
[0028] Training a plurality of base learners, wherein the base learners include a K-nearest neighbor algorithm, a random forest algorithm, and a gradient boosting regression algorithm;
[0029] The prediction results of the base learner are used as input, and a meta learner is trained to fuse the prediction results of the base learner to construct the peanut fluctuation yield prediction model, wherein the meta learner is a minimum absolute shrinkage and selection operator regression algorithm.
[0030] Optionally, the historical meteorological data includes one or any multiple of historical temperature, historical precipitation, historical sunshine duration, historical wind speed and historical relative humidity.
[0031] A peanut yield prediction device provided for another purpose of the present application comprises:
[0032] A data acquisition module is configured to respond to the peanut yield prediction instruction and acquire the historical meteorological data of peanuts in the target area during the growth and development stage and the corresponding historical annual yield;
[0033] A trend yield prediction construction module is configured to use a decomposition model method to decompose the historical annual yield to determine the trend yield and fluctuation yield of peanuts, construct a peanut trend yield prediction model based on the trend yield and fluctuation yield through a polynomial regression model, and calculate the historical annual fluctuation yield related to meteorological data, wherein the historical annual fluctuation yield represents the annual production change of peanuts in the target area;
[0034] A fluctuation yield prediction construction module is configured to perform principal component analysis on the historical meteorological data using a principal component analysis method, determine the principal component meteorological features corresponding to the cumulative variance contribution exceeding a preset percentage in the historical meteorological data, and construct a peanut fluctuation yield prediction model based on the principal component meteorological features corresponding to the cumulative variance contribution exceeding the preset percentage and the historical annual fluctuation yield training preset stacking model;
[0035] The peanut yield prediction module is configured to determine the peanut yield of the year based on the peanut trend yield prediction model and the peanut fluctuation yield prediction model according to the meteorological data of the peanuts in the growth and development stage of the target area, so as to complete the prediction of the peanut yield.
[0036] An electronic device provided to meet another purpose of the present application includes a central processing unit and a memory, wherein the central processing unit is used to call and run a computer program stored in the memory to execute the steps of the peanut yield prediction method described in the present application.
[0037] A computer-readable storage medium is provided to meet another purpose of the present application, which stores a computer program implemented according to the peanut yield prediction method in the form of computer-readable instructions. When the computer program is called and executed by a computer, the steps included in the corresponding method are executed.
[0038] Compared with the prior art, the present application aims at the problems that the single machine learning model in the prior art is used to predict crop yield, or the parameter function is used to simulate the response of crop yield to input variables to predict crop yield, which is difficult to fully capture the complex nonlinear relationship between crop yield and meteorological factors, and may reduce the prediction accuracy of peanut yield. The present application includes but is not limited to the following beneficial effects:
[0039] This application overcomes the limitations of previous methods that focus on a single model and have difficulty capturing the complex nonlinear relationship between crop yield and meteorological factors. By using big data technology and meteorological data, this application proposes a peanut yield prediction method and system based on polynomial regression and stacking models. First, by constructing a trend yield prediction model using the polynomial regression method, the long-term trend of peanut yield can be accurately grasped, which helps to make corresponding production and management decisions. Secondly, the stacking model is used to construct a fluctuating yield prediction model. By integrating the advantages of different basis learners, the model's robustness to data noise and outliers is improved, thereby significantly improving the accuracy of peanut yield prediction.
[0040] In addition, the method of the present application is not only applicable to the yield prediction of peanuts, but can also be extended to the yield prediction of other crops, such as rice, wheat, corn, etc., and has broad application prospects and significant economic value. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0042] Figure 1 A schematic diagram of a peanut yield prediction method in an embodiment of the present application;
[0043] Figure 2 This is a schematic diagram of the growth stages of peanuts in a certain place in the embodiments of this application;
[0044] Figure 3 This is a schematic diagram of the decomposition results of the peanut production model in a certain city from 2000 to 2020 in the embodiment of the present application;
[0045] Figure 4 A flowchart of constructing a stacking model in an embodiment of the present application;
[0046] Figure 5 A schematic diagram showing the effect comparison of using a stacked model instead of a single model in an embodiment of the present application;
[0047] Figure 6 This is a schematic diagram of the predicted yield and actual yield results of peanuts in some areas of a certain place in 2020 in the embodiments of the present application;
[0048] Figure 7This is a functional block diagram of a peanut yield prediction device in an embodiment of the present application;
[0049] Figure 8 It is a schematic diagram of the structure of the computer device in the embodiment of the present application. DETAILED DESCRIPTION
[0050] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0051] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be an intermediate element. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0052] It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as those generally understood by those skilled in the art to which this application belongs. It should also be understood that terms such as those defined in general dictionaries should be understood to have meanings consistent with those in the context of the prior art, and will not be interpreted with idealized or overly formal meanings unless specifically defined as here.
[0053] It will be understood by those skilled in the art that the terms "client", "terminal" and "terminal device" as used herein include both devices with wireless signal receivers, which are devices with only wireless signal receivers without transmission capability, and devices with receiving and transmitting hardware, which are devices with receiving and transmitting hardware capable of two-way communication over a two-way communication link. Such devices may include: cellular or other communication devices such as personal computers, tablet computers, which have single-line displays or multi-line displays or cellular or other communication devices without multi-line displays; PCS (Personal Communications Services) which may combine voice, data processing, fax and / or data communication capabilities; PDA (Personal Digital Assistant) which may include a radio frequency receiver, pager, Internet / intranet access, web browser, notepad, calendar and / or GPS (Global Positioning System) receiver; conventional laptop and / or palmtop computers or other devices which have and / or include a radio frequency receiver. The "client", "terminal" and "terminal device" used herein may be portable, transportable, installed in a vehicle (air, sea and / or land), or adapted and / or configured to run locally, and / or in a distributed form, at any other location on the earth and / or in space. The "client", "terminal" and "terminal device" used herein may also be a communication terminal, an Internet terminal, a music / video playing terminal, such as a PDA, a MID (Mobile Internet Device) and / or a mobile phone with a music / video playing function, or may be a smart TV, a set-top box and other devices.
[0054] The hardware referred to by the names such as "server", "client", and "service node" in this application is essentially an electronic device with the equivalent capabilities of a personal computer. It is a hardware device with the necessary components revealed by the von Neumann principle, such as a central processing unit (including an arithmetic unit and a controller), a memory, an input device, and an output device. The computer program is stored in its memory, and the central processing unit calls the program stored in the external memory into the internal memory for execution, executes the instructions in the program, and interacts with the input and output devices to complete specific functions.
[0055] It should be pointed out that the concept of "server" referred to in this application can also be extended to the case of server clusters. According to the network deployment principle understood by those skilled in the art, the servers should be logically divided. In physical space, these servers can be independent of each other but can be called through interfaces, or integrated into a physical computer or a set of computer clusters. Those skilled in the art should understand this flexibility, and should not use it to restrict the implementation of the network deployment method of this application.
[0056] Unless expressly specified, one or more technical features of the present application can be deployed on a server for implementation and accessed by a client through a remote call to obtain an online service interface provided by the server, or can be directly deployed and run on a client for access.
[0057] The neural network models referenced or may be referenced in this application, unless expressly specified, can be deployed on a remote server and remotely called on the client, or can be deployed and directly called on a client with sufficient device capabilities. In some embodiments, when it runs on the client, its corresponding intelligence can be obtained through transfer learning to reduce the requirements for the client's hardware operating resources and avoid excessive occupation of the client's hardware operating resources.
[0058] Unless explicitly specified, the various data involved in this application can be stored remotely on a server or on a local terminal device, as long as it is suitable for being called by the technical solution of this application.
[0059] Those skilled in the art should be aware that, although the various methods of the present application are described based on the same concept and thus present commonality to each other, unless otherwise specified, these methods can be independently executed. Similarly, for each embodiment disclosed in the present application, they are all proposed based on the same inventive concept, therefore, concepts with the same expression, and concepts that are appropriately changed for convenience despite different expressions, should be understood as equivalent.
[0060] Unless the mutually exclusive relationship between the embodiments to be disclosed in this application is explicitly stated, the relevant technical features involved in each embodiment can be cross-combined to flexibly construct a new embodiment, as long as such combination does not deviate from the creative spirit of this application and can meet the needs of the prior art or solve certain deficiencies in the prior art. Those skilled in the art should be aware of this flexibility.
[0061] See also Figure 1 In one embodiment, the peanut yield prediction method of the present application includes:
[0062] Step S10, responding to the peanut yield prediction instruction, obtaining the historical meteorological data of peanuts in the target area at the growth and development stage and its corresponding historical annual yield;
[0063] The peanut yield prediction system in smart agriculture can respond to the peanut yield prediction instruction to obtain the historical meteorological data of peanuts in the target area during the growth and development stage and its corresponding historical annual yield; the historical meteorological data includes one or any multiple of the historical temperature, historical precipitation, historical sunshine duration, historical wind speed and historical relative humidity, and the historical annual yield is the annual yield related to the historical temperature, historical precipitation, historical sunshine duration, historical wind speed and historical relative humidity.
[0064] In some embodiments, data preprocessing is performed on historical meteorological data, and monthly average meteorological data are obtained from the preprocessed data, including five meteorological characteristics, namely, average temperature, average precipitation, average sunshine duration, average wind speed, and average relative humidity;
[0065] Based on the acquisition of historical meteorological data, data preprocessing is performed to remove abnormal values and null values through data cleaning, and to eliminate dimensional differences in meteorological data through data normalization. The data normalization formula is as follows:
[0066]
[0067] Among them, X is the original data, X' is the normalized data, and X min and X max They represent the minimum and maximum values of the original data respectively. Min and max are the endpoints of the normalized interval, generally 0 and 1 or -1 and 1.
[0068] Corresponding to the peanut growth stage in the target area, this embodiment obtained the average monthly meteorological data from April to September each year from 2000 to 2020, including five meteorological characteristics such as average temperature, average precipitation, average sunshine duration, average wind speed and average relative humidity, a total of 30 characteristics.
[0069] Step S20, using a decomposition model method to decompose the historical annual yield to determine the trend yield and fluctuation yield of peanuts, constructing a peanut trend yield prediction model according to the trend yield and fluctuation yield through a polynomial regression model, and calculating the historical annual fluctuation yield related to meteorological data, wherein the historical annual fluctuation yield represents the annual production change of peanuts in the target area;
[0070] After obtaining the historical meteorological data of peanuts in the growth and development stage of the target area and the corresponding historical annual yield, the decomposition model method is used to decompose the historical annual yield to determine the trend yield and fluctuating yield of peanuts, and a peanut trend yield prediction model is constructed according to the trend yield and fluctuating yield through a polynomial regression model, and the historical annual fluctuating yield related to the meteorological data is calculated, wherein the historical annual fluctuating yield represents the annual production change of peanuts in the target area;
[0071] Furthermore, the steps of using a decomposition model method to decompose the historical annual yield to determine the trend yield and fluctuating yield of peanuts, and constructing a peanut trend yield prediction model according to the trend yield and fluctuating yield through a polynomial regression model include:
[0072] Step S201, preprocessing the data of the historical annual output to determine the time series data corresponding to the historical annual output;
[0073] Step S203, decomposing the historical annual yield based on a preset decomposition model method, using a moving average algorithm or an exponential smoothing algorithm in the decomposition model method to capture long-term trend changes to determine the trend yield of peanuts, and using a seasonal decomposition algorithm in the decomposition model method to determine the fluctuation yield of peanuts;
[0074] Step S205: construct a peanut trend yield prediction model based on the trend yield and the fluctuating yield through a polynomial regression model, and calculate the historical annual fluctuating yield related to the meteorological data.
[0075] In some embodiments, the historical annual yield is decomposed based on the decomposition model method to determine the trend yield, fluctuating yield and random yield of peanuts in the target area, and the expression is:
[0076] y e =x t +x f +e,
[0077] Among them, y e To predict the output, x t is the trend output, x f is the fluctuating yield, e is the random yield, the trend yield represents the long-term trend of peanut yield, the fluctuating yield represents the seasonal or interannual variation of crop yield, and the random yield represents the yield part caused by pests and diseases and natural disasters.
[0078] In the decomposition model method, the output of peanuts is usually decomposed into three parts: trend output, fluctuating output and random output, as shown below:
[0079] y e=x t +x f +e,
[0080] Among them, y e To predict the output, x t is the trend output, x f is the fluctuating yield, and e is the random yield. Trend yield reflects the long-term trend of crop yield, which is usually affected by factors such as agricultural technology. Fluctuating yield reflects the seasonal or interannual variation of crop yield, which is usually affected by factors such as climatic conditions. Random yield is the part of yield caused by pests and diseases, natural disasters and other uncertain factors. In this application, random yield is ignored, mainly because it usually contains random errors caused by data collection errors, incomplete model settings or other unconsidered factors, which are often difficult to quantify or predict, and their weights are small and generally negligible.
[0081] In some embodiments, the polynomial regression model is expressed as:
[0082] y=β0+β1x+β2x 2 +…+β n x n +∈,
[0083] Among them, y represents the trend output, x represents time, and β n are the coefficients of the polynomial and ∈ is the random error.
[0084] Specifically, polynomial regression is a method for analyzing changes in agricultural productivity, using polynomial functions to represent the long-term trend of yields. By estimating the coefficients of the polynomial, we can get the fitting curve of the yield trend and analyze its growth rate, growth rate, inflection point and other characteristics, as well as its relationship with climate, technology, policy and other factors. Specifically, if we assume that the trend yield is y and the time is x, we can use an n-order polynomial to represent the change law of the trend yield, that is:
[0085] y=β0+β1x+β2x 2 +…+β n x n +ε,
[0086] where β n are the coefficients of the polynomial, and ε is the random error
[0087] In some embodiments, the historical annual fluctuation yield related to meteorological data is calculated. First, the peanut yield data of the target area and its related meteorological data (such as precipitation, temperature, etc.) are obtained. The quality and integrity of the data are ensured, and possible missing values or outliers are processed; a meteorological impact model is established using regression analysis or other machine learning methods to evaluate the impact of meteorological factors on the fluctuation of peanut yield. This can be a linear regression model, in which meteorological numbers are used as factors for predicting the fluctuation of peanut yield; the established meteorological impact model is applied to the historical annual yield to predict the fluctuation yield of each year. These fluctuating yield values represent estimates of the annual yield fluctuations caused by meteorological data.
[0088] Step S30, using the principal component analysis method to perform principal component analysis on the historical meteorological data, determine the principal component meteorological features corresponding to the cumulative variance contribution exceeding the preset percentage in the historical meteorological data, and train a preset stacking model based on the principal component meteorological features corresponding to the cumulative variance contribution exceeding the preset percentage and the historical annual fluctuation yield to construct a peanut fluctuation yield prediction model;
[0089] After calculating the historical annual fluctuation yield related to the meteorological data, the principal component analysis method is used to perform principal component analysis on the historical meteorological data to determine the principal component meteorological features corresponding to the cumulative variance contribution exceeding the preset percentage in the historical meteorological data, and based on the principal component meteorological features corresponding to the cumulative variance contribution exceeding the preset percentage and the historical annual fluctuation yield, a preset stacking model is trained to construct a peanut fluctuation yield prediction model;
[0090] Further, the step of performing principal component analysis on the historical meteorological data using the principal component analysis method to determine the principal component meteorological features corresponding to the cumulative variance contribution in the historical meteorological data exceeding a preset percentage includes:
[0091] Step S301, obtaining historical meteorological data, calculating and determining the difference between the historical meteorological data and the mean of the historical meteorological data, and determining the ratio between the difference and the standard deviation of the historical meteorological data, so as to perform standardization processing on the historical meteorological data;
[0092] Step S303, calculating and determining the covariance matrix between the historical meteorological data, performing eigenvalue decomposition on the covariance matrix to obtain eigenvalues and their corresponding eigenvectors;
[0093] Step S305: Arrange the eigenvalues from large to small, and select the main component meteorological features corresponding to the eigenvalues with the highest rankings;
[0094] Step S307, calculating the variance contribution of each principal component meteorological feature, and calculating the cumulative variance contribution, and determining the principal component meteorological feature corresponding to the cumulative variance contribution exceeding the preset percentage in the historical meteorological data as the final principal component meteorological feature.
[0095] Principal component analysis is a data dimensionality reduction method that maps high-dimensional data to a low-dimensional space while retaining the most important information in the data.
[0096] Furthermore, the steps of constructing a peanut fluctuation yield prediction model include:
[0097] Step S3001, training multiple base learners, wherein the base learners include a K nearest neighbor algorithm, a random forest algorithm, and a gradient boosting regression algorithm;
[0098] Step S3003: using the prediction results of the base learner as input, training a meta learner to fuse the prediction results of the base learner to construct the peanut fluctuation yield prediction model, wherein the meta learner is a minimum absolute shrinkage and selection operator regression algorithm.
[0099] Specifically, the stacking algorithm is an ensemble learning method that combines the concepts of boosting and bagging. The algorithm first divides the original data set into multiple base learners for training according to certain rules, and then uses the prediction results of these base learners as the output of the first layer model. Subsequently, the output of the first layer is used as the input of the second layer model, which is trained by a meta-learner to obtain the final prediction result. The stacking model uses K-Nearest Neighbor (KNN), Random Forests (RF) and Gradient Boosting Regressor (GBR) as base learners, and Least Absolute Shrinkage and Selection Operator Regression (LASSO) as a meta-learner.
[0100] Step S40, based on the peanut trend yield prediction model and the peanut fluctuation yield prediction model, according to the meteorological data of the peanuts in the target area during the growth and development stage, determine the peanut yield of the year to complete the prediction of the peanut yield.
[0101] After constructing the peanut fluctuation yield prediction model, the peanut yield of the year is determined based on the peanut trend yield prediction model and the peanut fluctuation yield prediction model according to the meteorological data of the peanuts in the target area during the growth and development stage to complete the peanut yield prediction.
[0102] In some embodiments, historical meteorological data of the corresponding peanut growth stage in the target area and its corresponding historical annual yield are obtained;
[0103] As an implementation method of the present application, a schematic diagram of the growth stage of peanuts in a certain place is as follows: Figure 2 As shown; the historical meteorological data includes the historical temperature, historical precipitation, historical sunshine duration, historical average wind speed and historical relative humidity of peanuts during the growth and development stage, and the historical meteorological data can come from the National Meteorological Science Data Center.
[0104] The historical meteorological data were preprocessed, and the monthly average meteorological data were obtained from the preprocessed data, including five meteorological characteristics: average temperature, average precipitation, average sunshine duration, average wind speed, and average relative humidity. Based on the historical meteorological data, data preprocessing was performed to remove abnormal values and null values through data cleaning, and to eliminate dimensional differences in meteorological data through data normalization. The data normalization formula is as follows:
[0105]
[0106] Among them, X is the original data, X' is the normalized data, and X min and X max They represent the minimum and maximum values of the original data respectively. Min and max are the endpoints of the normalized interval, generally 0 and 1 or -1 and 1.
[0107] Corresponding to the peanut growth stage in the target area, this embodiment obtained the average monthly meteorological data from April to September each year from 2000 to 2020, including five meteorological characteristics such as average temperature, precipitation, sunshine duration, average wind speed and relative humidity, a total of 30 characteristics.
[0108] The decomposition model method was used for the historical annual yield data, and a trend yield prediction model was established through polynomial regression, and the historical annual fluctuation yield related to the weather was calculated. The principal component analysis was performed on the meteorological characteristics, and the principal component with a cumulative variance contribution of 90% and the historical annual fluctuation yield training stacking model were used to construct the peanut fluctuation yield prediction model;
[0109] For each major peanut producing area in the target area, a trend yield prediction model and a fluctuation yield prediction model are constructed respectively. Figure 3 As shown in the figure, the peanut production in a certain city from 2000 to 2020 was used to construct a trend yield prediction model using the polynomial regression method, and the historical annual fluctuation yield related to meteorology was calculated. Figure 4As shown in the figure, K nearest neighbor, random forest and gradient boosting regression are used as base learners, and minimum absolute shrinkage and selection operator regression are used as meta-learners to build a stacking model; principal component analysis is performed on meteorological characteristics, and a data set is constructed using principal components with a cumulative variance contribution of 90% and historical annual fluctuations in production. During the model training process, the data from 2020 was retained to verify the model prediction performance, and the remaining data was divided into a training set and a test set at a ratio of 3:1 for the construction and verification of the peanut fluctuation production prediction model.
[0110] Compare the improvement in prediction accuracy after using stacked models instead of single models or methods: Figure 5 As shown in the figure, from the experimental results, the scheme using the stacked model has higher prediction accuracy than the single model and has the smallest prediction error.
[0111] The current year's meteorological data of the target area corresponding to the peanut growth stage is input into the trained fluctuation yield prediction model, and combined with the trend yield predicted by the trend yield prediction model to realize the peanut yield prediction for the current year.
[0112] In some embodiments, 2020 is used as a validation year to validate the prediction effect of the peanut yield prediction method based on polynomial regression and stacking model; Figure 6 The comparison between the predicted and actual peanut yields in some areas was shown. The results showed that the peanut yield prediction method based on polynomial regression and stacking model has good prediction accuracy and stability, and can be applied to actual peanut yield prediction.
[0113] It can be seen from the above embodiments that, compared with the prior art, the present application aims at the problems that a single machine learning model in the prior art is used to predict crop yield, or a parameter function is used to simulate the response of crop yield to input variables to predict crop yield, which is difficult to fully capture the complex nonlinear relationship between crop yield and meteorological factors, and may reduce the prediction accuracy of peanut yield. The present application includes but is not limited to the following beneficial effects:
[0114] This application overcomes the limitations of previous methods that focus on a single model and have difficulty capturing the complex nonlinear relationship between crop yield and meteorological factors. By using big data technology and meteorological data, this application proposes a peanut yield prediction method and system based on polynomial regression and stacking models. First, by constructing a trend yield prediction model using the polynomial regression method, the long-term trend of peanut yield can be accurately grasped, which helps to make corresponding production and management decisions. Secondly, the stacking model is used to construct a fluctuating yield prediction model. By integrating the advantages of different basis learners, the model's robustness to data noise and outliers is improved, thereby significantly improving the accuracy of peanut yield prediction.
[0115] In addition, the method of the present application is not only applicable to the yield prediction of peanuts, but can also be extended to the yield prediction of other crops, such as rice, wheat, corn, etc., and has broad application prospects and significant economic value.
[0116] See also Figure 7 A peanut yield prediction device provided to meet one of the purposes of the present application includes a data acquisition module 1100, a trend yield prediction construction module 1200, a fluctuation yield prediction construction module 1300 and a peanut yield prediction module 1400. Among them, the data acquisition module 1100 is configured to respond to the peanut yield prediction instruction and obtain the historical meteorological data of peanuts in the growth and development stage of the target area and its corresponding historical annual yield; the trend yield prediction construction module 1200 is configured to use the decomposition model method to decompose the historical annual yield to determine the trend yield and fluctuation yield of peanuts, construct a peanut trend yield prediction model according to the trend yield and fluctuation yield through a polynomial regression model, and calculate the historical annual fluctuation yield related to the meteorological data, wherein the historical annual fluctuation yield represents the annual production volume change of peanuts in the target area; the fluctuation yield prediction construction module 1300 is configured to use the principal component analysis method to perform principal component analysis on the historical meteorological data, determine the principal component meteorological features corresponding to the cumulative variance contribution exceeding the preset percentage in the historical meteorological data, and train a preset stacking model based on the principal component meteorological features corresponding to the cumulative variance contribution exceeding the preset percentage and the historical annual fluctuation yield to construct a peanut fluctuation yield prediction model; the peanut yield prediction module 1400 is configured to determine the peanut yield of the year based on the peanut trend yield prediction model and the peanut fluctuation yield prediction model according to the meteorological data of peanuts in the growth and development stage of the target area to complete the prediction of peanut yield.
[0117] Based on any embodiment of this application, please refer to Figure 8 Another embodiment of the present application further provides an electronic device, which can be implemented by a computer device, such as Figure 8As shown, a schematic diagram of the internal structure of a computer device. The computer device includes a processor, a computer-readable storage medium, a memory, and a network interface connected via a system bus. Among them, the computer-readable storage medium of the computer device stores an operating system, a database, and computer-readable instructions. The database may store a control information sequence. When the computer-readable instructions are executed by the processor, the processor can implement a peanut yield prediction method. The processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device. The memory of the computer device may store computer-readable instructions. When the computer-readable instructions are executed by the processor, the processor can execute the peanut yield prediction method of the present application. The network interface of the computer device is used to connect and communicate with a terminal. Those skilled in the art can understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0118] In this embodiment, the processor is used to execute Figure 7 The memory stores the program code and various data required to execute the above modules or submodules. The network interface is used to transmit data between user terminals or servers. The memory in this embodiment stores the program code and data required to execute all modules / submodules in the peanut yield prediction device of the present application, and the server can call the program code and data of the server to execute the functions of all submodules.
[0119] The present application also provides a storage medium storing computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the steps of the peanut yield prediction method described in any embodiment of the present application.
[0120] The present application also provides a computer program product, including a computer program / instruction, which, when executed by one or more processors, implements the steps of the peanut yield prediction method described in any embodiment of the present application.
[0121] A person skilled in the art can understand that all or part of the processes in the above-mentioned embodiments of the present application can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a computer-readable storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0122] The above description is only a partial implementation method of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
[0123] In summary, this application improves the robustness of the model to data noise and outliers by integrating the advantages of different base learners, thereby significantly improving the accuracy of peanut yield prediction. In addition, the method of this application is not only applicable to peanut yield prediction, but can also be extended to yield prediction of other crops, such as rice, wheat, corn, etc., with broad application prospects and significant economic value.
Claims
1. A peanut yield prediction method, characterized in that: include: In response to the peanut yield forecast instruction, the historical meteorological data of peanuts in the target area during the growth and development stage and the corresponding historical annual yield are obtained; The decomposition model method is used to decompose the historical annual yield to determine the trend yield and fluctuation yield of peanuts, and a peanut trend yield prediction model is constructed according to the trend yield and fluctuation yield through a polynomial regression model, and the historical annual fluctuation yield related to meteorological data is calculated, wherein the historical annual fluctuation yield represents the annual production change of peanuts in the target area; The historical meteorological data are subjected to principal component analysis by using the principal component analysis method to determine the principal component meteorological features corresponding to the cumulative variance contribution exceeding the preset percentage in the historical meteorological data, and the preset stacking model is trained based on the principal component meteorological features corresponding to the cumulative variance contribution exceeding the preset percentage and the historical annual fluctuation yield to construct a peanut fluctuation yield prediction model; Based on the peanut trend yield prediction model and the peanut fluctuation yield prediction model, the peanut yield of the year is determined according to the meteorological data of the peanuts in the target area during the growth and development stage to complete the prediction of the peanut yield.
2. The peanut yield prediction method according to claim 1, characterized in that: The steps of using a decomposition model method to decompose the historical annual yield to determine the trend yield and fluctuating yield of peanuts, and constructing a peanut trend yield prediction model according to the trend yield and fluctuating yield through a polynomial regression model include: Performing data preprocessing on the historical annual output to determine the time series data corresponding to the historical annual output; Decomposing the historical annual yield based on a preset decomposition model method, using a moving average algorithm or an exponential smoothing algorithm in the decomposition model method to capture long-term trend changes to determine the trend yield of peanuts, and using a seasonal decomposition algorithm in the decomposition model method to determine the fluctuation yield of peanuts; A peanut trend yield prediction model is constructed based on the trend yield and fluctuating yield through a polynomial regression model, and the historical annual fluctuating yield related to meteorological data is calculated.
3. The peanut yield prediction method according to claim 2, characterized in that: The historical annual yield is decomposed based on the decomposition model method to determine the trend yield, fluctuating yield and random yield of peanuts in the target area, and the expression is: y e =x t +x f +e, Among them, y e To predict the output, x t is the trend output, x f is the fluctuating yield, e is the random yield, the trend yield represents the long-term trend of peanut yield, the fluctuating yield represents the seasonal or interannual variation of crop yield, and the random yield represents the yield part caused by pests and diseases and natural disasters.
4. The peanut yield prediction method according to claim 2, characterized in that: The polynomial regression model is expressed as: y=β0+β1x+β2x 2 +…+b n x n +∈, Among them, y represents the trend output, x represents time, and β n are the coefficients of the polynomial and ∈ is the random error.
5. The peanut yield prediction method according to claim 1, characterized in that: The step of performing principal component analysis on the historical meteorological data by using the principal component analysis method to determine the principal component meteorological characteristics corresponding to the cumulative variance contribution in the historical meteorological data exceeding a preset percentage includes: Acquire historical meteorological data, calculate and determine the difference between the historical meteorological data and the mean of the historical meteorological data, and determine the ratio between the difference and the standard deviation of the historical meteorological data, so as to perform standardization processing on the historical meteorological data; Calculate and determine the covariance matrix between the historical meteorological data, perform eigenvalue decomposition on the covariance matrix, and obtain eigenvalues and their corresponding eigenvectors; Arrange the eigenvalues from large to small, and select the principal component meteorological features corresponding to the eigenvalues with the highest rankings; The variance contribution of each principal component meteorological feature is calculated, and the cumulative variance contribution is calculated, and the principal component meteorological feature corresponding to the cumulative variance contribution exceeding a preset percentage in the historical meteorological data is determined as the final principal component meteorological feature.
6. The peanut yield prediction method according to claim 1, characterized in that: The steps to construct a peanut fluctuation yield prediction model include: Training a plurality of base learners, wherein the base learners include a K-nearest neighbor algorithm, a random forest algorithm, and a gradient boosting regression algorithm; The prediction results of the base learner are used as input, and a meta learner is trained to fuse the prediction results of the base learner to construct the peanut fluctuation yield prediction model, wherein the meta learner is a minimum absolute shrinkage and selection operator regression algorithm.
7. The peanut yield prediction method according to any one of claims 1 to 6, characterized in that: The historical meteorological data include one or more of historical temperature, historical precipitation, historical sunshine duration, historical wind speed and historical relative humidity.
8. A peanut yield prediction device, characterized in that: include: A data acquisition module is configured to respond to the peanut yield prediction instruction and acquire the historical meteorological data of peanuts in the target area during the growth and development stage and the corresponding historical annual yield; A trend yield prediction construction module is configured to use a decomposition model method to decompose the historical annual yield to determine the trend yield and fluctuation yield of peanuts, construct a peanut trend yield prediction model based on the trend yield and fluctuation yield through a polynomial regression model, and calculate the historical annual fluctuation yield related to meteorological data, wherein the historical annual fluctuation yield represents the annual production change of peanuts in the target area; A fluctuation yield prediction construction module is configured to perform principal component analysis on the historical meteorological data using a principal component analysis method, determine the principal component meteorological features corresponding to the cumulative variance contribution exceeding a preset percentage in the historical meteorological data, and construct a peanut fluctuation yield prediction model based on the principal component meteorological features corresponding to the cumulative variance contribution exceeding the preset percentage and the historical annual fluctuation yield training preset stacking model; The peanut yield prediction module is configured to determine the peanut yield of the year based on the peanut trend yield prediction model and the peanut fluctuation yield prediction model according to the meteorological data of the peanuts in the growth and development stage of the target area, so as to complete the prediction of the peanut yield.
9. An electronic device, comprising a central processing unit and a memory, characterized in that: The central processing unit is used to call and run the computer program stored in the memory to execute the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: It stores a computer program implemented according to the method described in any one of claims 1 to 7 in the form of computer-readable instructions, and when the computer program is called and executed by a computer, the steps included in the corresponding method are executed.
