Method and device for predicting crop yield
Crop monitoring data are obtained through global positioning systems, geographical information systems and remote sensing technologies, and the scalable regression tree algorithm is used to build models, which solves the problem of incomplete crop harvest prediction data in the existing technology and achieves higher prediction accuracy. and data coverage.
Patent Information
- Application Number
- CN202110012278.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-01-06
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-01-06
AI Technical Summary
Existing crop harvest prediction methods have incomplete data and low accuracy, making it difficult to meet the needs of crop yield improvement and food safety.
Global positioning system, geographical information system and remote sensing technology are used to obtain crop monitoring data, a model is built through a scalable regression tree algorithm, feature data is extracted and normalized, and the pre-trained regression tree model is input to output harvest prediction data .
Through the use of full life cycle monitoring data, the accuracy of prediction and the comprehensiveness of data are improved. The model is scalable and can adapt to changes in data volume and calculation volume, improving the accuracy of crop harvest prediction.
Smart Images

Figure CN112785047B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of deep learning technology, and in particular to a method and device for predicting crop yield. Background Art
[0002] With the increasing population and food safety issues, crop yields are under pressure to be increased. In addition, global climate change has caused incalculable losses to crops in different regions, so it is necessary to monitor the farm environment and crop growth in real time.
[0003] The crop yield can be predicted by using information on several growth factors in the greenhouse, by simple statistics and prediction based on historical crop yield data, or by remote sensing technology. However, the data used in the above prediction methods are not comprehensive and the accuracy is not high. Summary of the invention
[0004] In view of this, an object of the present invention is to provide a method and device for predicting crop yield to improve the accuracy of prediction.
[0005] In a first aspect, an embodiment of the present invention provides a method for predicting crop yields, the method comprising: acquiring monitoring data of crops based on a global positioning system, a geographic information system and remote sensing technology; determining feature data corresponding to the monitoring data; the feature data characterizing data affecting the crop yields; inputting the feature data into a pre-trained regression tree model, and outputting crop yield prediction data; wherein the regression tree model is constructed based on a scalable regression tree algorithm.
[0006] In a preferred embodiment of the present invention, the above-mentioned monitoring data includes crop growth monitoring data, climate and environment monitoring data, and pest and disease monitoring data; the above-mentioned steps of obtaining crop monitoring data based on the global positioning system, geographic information system and remote sensing technology include: determining the planting area of crops with specified coordinates based on the global positioning system; mapping the planting area of crops based on the geographic information system and outputting multiple layers; determining the crop growth monitoring data, climate and environment monitoring data, and pest and disease monitoring data corresponding to the multiple layers through remote sensing technology.
[0007] In a preferred embodiment of the present invention, the step of determining characteristic data corresponding to the monitoring data includes: determining the type of data that affects the yield of crops; and extracting characteristic data corresponding to the monitoring data from the monitoring data based on the type of data.
[0008] In a preferred embodiment of the present invention, the step of inputting the feature data into the pre-trained regression tree model includes: normalizing the feature data; and inputting the normalized feature data into the pre-trained regression tree model.
[0009] In a preferred embodiment of the present invention, the above-mentioned regression tree model is trained through the following steps: obtaining training samples and the harvest amounts corresponding to the training samples; wherein the training samples and the harvest amounts corresponding to the training samples are obtained based on historical monitoring data of crops; constructing a regression tree with a preset quantity threshold of the regression tree model based on the training samples; adjusting the parameters of the regression tree model according to the training results of the training samples; continuing to execute the steps of obtaining training samples and the harvest amounts corresponding to the training samples until the preset training end conditions are met, and determining the trained regression tree model as the trained regression tree model.
[0010] In a preferred embodiment of the present invention, after the step of determining the trained regression tree model as the trained regression tree model, the method further comprises: verifying the trained regression tree model based on a preset verification sample.
[0011] In a preferred embodiment of the present invention, the above method also includes: determining training samples and verification samples from historical monitoring data of crops based on a preset ratio; wherein the historical monitoring data includes historical characteristic data of crops and the harvest amount corresponding to the historical characteristic data.
[0012] In a preferred embodiment of the present invention, the step of constructing the first regression tree of the regression tree model based on the training samples includes: calculating the gain value of each feature in the training samples to obtain the target feature corresponding to the maximum gain value; branching nodes based on the target feature, dividing the training samples, and constructing the first regression tree of the regression tree model; wherein the tree height of the first regression tree does not exceed a preset height threshold.
[0013] In a preferred embodiment of the present invention, the above training end conditions include: the number of regression trees of the regression tree model is equal to the number threshold; and the change amount of the parameters of the regression tree model is less than the preset change threshold.
[0014] In a second aspect, an embodiment of the present invention further provides a device for predicting crop yields, the device comprising: a monitoring data acquisition module, for acquiring monitoring data of crops based on a global positioning system, a geographic information system and remote sensing technology; a feature data determination module, for determining feature data corresponding to the monitoring data; the feature data represents data affecting the crop yield; a yield prediction module, for inputting the feature data into a pre-trained regression tree model, and outputting crop yield prediction data; wherein the regression tree model is constructed based on a scalable regression tree algorithm.
[0015] The embodiments of the present invention bring the following beneficial effects:
[0016] The embodiments of the present invention provide a method and device for predicting the harvest of crops. The method obtains monitoring data of crops based on the global positioning system, geographic information system and remote sensing technology, inputs the feature data corresponding to the monitoring data into a regression tree model constructed based on a scalable regression tree algorithm, and outputs the predicted data of the harvest of crops. In this method, the growth data of crops at different stages of their entire life cycle can be monitored through the global positioning system, geographic information system and remote sensing technology. The data used in modeling is comprehensive and the stock is huge, which can maximize the prediction accuracy from the data perspective; the regression tree model is constructed based on the scalable regression tree algorithm, which can simultaneously increase and decrease the amount of data and the amount of calculation, and the model is scalable.
[0017] Other features and advantages of the present disclosure will be set forth in the following description, or some features and advantages may be inferred or unambiguously determined from the description, or may be learned by implementing the above-mentioned technology of the present disclosure.
[0018] In order to make the above-mentioned objectives, features and advantages of the present disclosure more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0020] Figure 1 A flowchart of a crop yield prediction method provided by an embodiment of the present invention;
[0021] Figure 2 A flowchart of another crop yield prediction method provided by an embodiment of the present invention;
[0022] Figure 3 A schematic diagram of a crop yield prediction method provided by an embodiment of the present invention;
[0023] Figure 4 A schematic diagram of characteristic data provided by an embodiment of the present invention;
[0024] Figure 5 A schematic diagram of the structure of a crop harvest prediction device provided by an embodiment of the present invention;
[0025] Figure 6A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0027] At present, in the method for predicting the harvest of crops, the data used for prediction is not comprehensive and the accuracy is not high. Based on this, the embodiment of the present invention provides a method and device for predicting the harvest of crops, which can use 3S technology and big data analysis technology to monitor in real time and accurately predict the crop yield in the future. Among them, 3S technology includes global positioning system (GPS, Global Positioning Systems), geographic information system (GIS, Geography Information Systems) and remote sensing technology (RS, Remote Sensing), specifically involving a method for predicting the harvest of crops based on a scalable regression tree.
[0028] To facilitate understanding of this embodiment, a crop harvest prediction method disclosed in an embodiment of the present invention is first introduced in detail.
[0029] Embodiment 1:
[0030] This embodiment provides a method for predicting the harvest amount of crops. Figure 1 The flowchart of a crop yield prediction method shown in FIG. 1 includes the following steps:
[0031] Step S102, obtaining monitoring data of crops based on global positioning system, geographic information system and remote sensing technology.
[0032] 3S technology is a new comprehensive technology based on the global positioning system (GPS), geographic information system (GIS) and remote sensing technology (RS). It organically integrates the relevant parts of the three independent technical fields of RS, GIS and GPS with other technical fields such as network technology and communication technology to form a whole. It integrates information acquisition, information processing and information application, and is outstanding in the high speed and real-time of information acquisition and processing, and the high precision and high quantification of application. 3S technology has been widely used in agricultural fields such as land use survey and soil erosion monitoring.
[0033] In this embodiment, 3S technology is used to monitor the real-time growth of crops and environmental information in the field, and scalable regression tree modeling is used to predict the crop yield. Based on the global positioning system, geographic information system and remote sensing technology, the monitoring data of crops is obtained, and the crop yield is predicted based on the monitoring data of crops.
[0034] Specifically, firstly, the global positioning system (GPS) is used to take remote sensing images within each coordinate area to identify the crop types in the farmland and greenhouses, and then the geographic information system (GIS) is used to form crop distribution maps, GIS collection yield maps, soil physical properties, soil nutrient content, crop agricultural information, and pest and disease information. Finally, the real-time information of remote sensing technology (RS) is used to dynamically monitor the soil spatial information, and then the monitoring data is sent back to the database to build a regression prediction model and predict the estimated value of crop harvest in real time.
[0035] Step S104, determining characteristic data corresponding to the monitoring data; the characteristic data represents data that affects the harvest amount of crops.
[0036] After obtaining the monitoring data of the crops, it is possible to determine the data that affects the harvest amount of the crops extracted from all the detection data as the feature data corresponding to the monitoring data.
[0037] Step S106, inputting the feature data into a pre-trained regression tree model, and outputting crop yield prediction data; wherein the regression tree model is constructed based on a scalable regression tree algorithm.
[0038] The regression tree model in this embodiment is built based on the scalable regression tree algorithm, which is an algorithm for regression prediction. Regression prediction is a machine learning method that uses labeled data to build a regression model and predict future target values in a supervised learning scenario. Labeled data is data with a one-to-one correspondence between feature data and target value data. Regression is the process of building a model using existing labeled data to find the best mapping from feature data to target value data. The model will iterate many times during training. After the model training is completed, the parameters tend to be stable. At this time, the feature data can be input into the model, and the model will output the predicted target value after calculation. This process is prediction.
[0039] Classification and regression tree (CART) is a decision tree model for classification and regression. It achieves binary classification and regression prediction of data sets by establishing split nodes layer by layer, and uses the information entropy of the attribute as the basis for prioritizing the split points. Unlike other decision trees such as ID3 and C4.5 (ID3 and C4.5 are two decision trees of different heights), CART uses the Gini index as an indicator for constructing split nodes. CART constructs a binary tree by continuously splitting the features of the data set. For example, the current tree node is split based on the jth eigenvalue. Usually, there are multiple values for the jth feature. By calculating the Gini index, we can calculate the best split point for the jth feature. Suppose that samples with a eigenvalue less than s are divided into the left subtree, and samples with a eigenvalue greater than s are divided into the right subtree.
[0040] Each time CART constructs a branch node, it will select a feature and divide the existing data set into two, the left subtree and the right subtree. The left subtree and the right subtree will continue to select the remaining features for segmentation based on the largest Gini index in the current data set (no longer using the previously used features), and so on to continuously generate trees, while continuing to segment the divided data set until the maximum height of the tree defined before modeling is met. After the CART model is built, all leaf nodes are nodes for classification (or regression prediction) of each sample. Since only the left and right subtrees need to be selected after each attribute segmentation, its tree building process is usually faster than other decision tree algorithms.
[0041] The Gini index can be calculated by the following formula: 1 (j,s)={x|x (j) ≤s}andR 2 (j,s)={x|x (j) >s}; where x represents a sample in the data set, j represents the jth feature, and x (j) represents the jth feature of sample x, s is the split point calculated from the jth feature. Since the CART tree is a binary tree, the node feature values are calculated and split into different child nodes, and R1 and R2 are two branch nodes.
[0042] The objective function of CART is as follows: Represents the predicted value The loss error with the actual labeled value y, Ω represents the penalty term for the tree. The penalty term avoids overfitting caused by excessive complexity of the model by limiting the number of leaf nodes or the height of the tree.
[0043] The embodiment of the present invention provides a method for predicting the harvest of crops. The method obtains monitoring data of crops based on the global positioning system, geographic information system and remote sensing technology, inputs the feature data corresponding to the above monitoring data into a regression tree model constructed based on a scalable regression tree algorithm, and outputs the predicted data of the harvest of crops. In this method, the growth data of crops at different stages of their entire life cycle can be monitored through the global positioning system, geographic information system and remote sensing technology. The data used in modeling is comprehensive and the stock is huge, which can maximize the prediction accuracy from the data perspective; the regression tree model is constructed based on the scalable regression tree algorithm, which can simultaneously increase and decrease the amount of data and the amount of calculation, and the model is scalable.
[0044] Embodiment 2:
[0045] This embodiment provides another crop yield prediction method, which is implemented on the basis of the above embodiment; this embodiment focuses on describing the specific implementation method of training the subjective evaluation model. Figure 2 The flowchart of another crop yield prediction method is shown in FIG. 1 . The crop yield prediction method in this embodiment includes the following steps:
[0046] Step S202, obtaining monitoring data of crops based on global positioning system, geographic information system and remote sensing technology.
[0047] See also Figure 3 A schematic diagram of a crop harvest prediction method is shown, wherein the monitoring data includes crop growth monitoring data, climate and environment monitoring data, and pest and disease monitoring data. The crop monitoring data can be obtained through the following steps: determining the crop planting area of the specified coordinates based on the global positioning system; processing the crop planting area into a map based on the geographic information system and outputting multiple layers; determining the crop growth monitoring data, climate and environment monitoring data, and pest and disease monitoring data corresponding to the multiple layers through remote sensing technology.
[0048] 3S technical data monitoring is to use the global positioning system to locate the farmland and greenhouses (i.e. the planting area of crops) at the specified coordinates, and use the geographic information system to map the area where the specified geographical location is located and output multiple layers, covering the identification of crop types, soil geological maps, annual precipitation maps, annual temperature change maps, etc. At the same time, remote sensing technology is used to monitor and output crop growth data, climate and environmental data, and pest and disease data, and then these data are generated into remote sensing real-time data streams, which enter the database in the form of streams.
[0049] Step S204, determining characteristic data corresponding to the monitoring data; the characteristic data represents data that affects the harvest amount of the crops.
[0050] In this embodiment, it is necessary to collect all indicator data (i.e., characteristic data) that affect the growth of crops. This part of data can come from a database. Specifically, it includes production data, climate and environmental data, and pest and disease data. The collected data are classified and sorted, and indicators are defined. Specifically, characteristic data can be extracted from monitoring data according to different types of characteristic data, for example: determining the type of data that affects the harvest of crops; extracting characteristic data corresponding to the monitoring data from the monitoring data based on the type of data.
[0051] See also Figure 4 The schematic diagram of a characteristic data shown in FIG. 1 shows that the crop growth data may include: plot location (longitude, latitude), plot area, planted crop type, crop variety, plot type, etc. Climate environment data may include: monthly average temperature, monthly average humidity, daily maximum light intensity, daily maximum temperature, daily minimum temperature, etc. Disease, insect and weed data may include: disease category, insect pest category, weed category, hazard level, hazard area, etc. Characteristic data collection refers to the collection of data from all aspects that affect the crop harvest. The collected data covers all aspects of crops from planting, growth, farming operations, harvesting, etc.
[0052] Step S206, normalizing the feature data.
[0053] In this embodiment, the training data needs to be preprocessed before modeling. Since the prediction target is the crop harvest, this problem is a regression problem. Therefore, all feature data and target values to be predicted need to be processed into numerical data. At the same time, in order to eliminate the different values of data due to different statistical units of different attributes, feature normalization is also required before this. Normalization is to map the representation range of all data to [0-1]. The specific formula is as follows:
[0054] Step S208, inputting the normalized feature data into a pre-trained regression tree model, and outputting crop yield prediction data.
[0055] The regression tree model in this embodiment is constructed based on a scalable regression tree algorithm and can be trained through steps A1 to A4:
[0056] Step A1, obtaining training samples and the harvest amounts corresponding to the training samples; wherein the training samples and the harvest amounts corresponding to the training samples are obtained based on historical monitoring data of crops.
[0057] In this embodiment, in addition to the training samples (also called training sets) used to train the regression tree model, the trained regression tree model can also be verified by the verification samples (also called verification sets). Both the training set and the verification set can be historical monitoring data. Therefore, in this embodiment, the training samples and the verification samples can be determined from the historical monitoring data of the crops based on a preset ratio; wherein the historical monitoring data includes the historical characteristic data of the crops and the harvest amount corresponding to the historical characteristic data.
[0058] In this embodiment, 5-fold cross-validation can be used to test the model effect. All labeled data are randomly shuffled and split into five parts according to the amount of data. The corresponding relationship of each sample data remains unchanged. The five split data are used, and four of them are used for each iterative training, and the remaining one is used as a validation set; each data is used as a validation set for 5 iterations, and the remaining 4 are used as training sets. In this way, 5 training and validation can be performed, and the average of the results of the validation set is taken as the final result, that is, the preset ratio of the above-mentioned validation sample: training sample is 1:4.
[0059] Step A2: constructing a regression tree with a preset number threshold of the regression tree model based on the training samples.
[0060] The objective function of the algorithm used in this embodiment is composed of the cumulative loss function of multiple trees and the regularization terms of multiple trees, and is specifically defined as follows:
[0061] in represents the loss function, where is the predicted output, y i is the marked value, f k is the kth tree model, T is the number of leaf nodes, w is the leaf weight value, and γ is the leaf tree penalty regularization term, which is used to avoid overfitting. The scalable regression tree used in this embodiment is to fit the residual of the last prediction, that is, after generating the tth (t is [1, k]) tree, the predicted value of the sample can be written as:
[0062] At the same time, the objective function can be rewritten as follows: This embodiment uses a second-order Taylor formula in f t = 0, the objective function approximation is: In this way, for any sample, the predicted value after constructing t trees can be calculated using the first-order derivative g of the sample. i and the second-order derivative h i Approximate expansion.
[0063] In this embodiment, multiple CART trees (hereinafter referred to as trees) will be established in sequence during modeling. When modeling, hyperparameters are first defined, including the total number of trees K = 10 and the maximum tree height H = 7. First, the first tree is constructed with the training set. The first tree is the first regression tree of the regression tree model, which can be trained in the following way: the gain value of each feature in the training sample is calculated to obtain the target feature corresponding to the maximum gain value; branch nodes are made based on the target feature, the training sample is divided, and the first regression tree of the regression tree model is constructed; wherein the tree height of the first regression tree does not exceed the preset height threshold.
[0064] Gain is calculated for all features in the training set to obtain the feature with the largest Gain and the segmentation point of the corresponding feature. The features with the largest Gain value are selected as branch nodes in turn, and the tree is continuously grown and the training set is continuously divided to ensure that the tree height does not exceed the maximum height. The specific formula for the gain value is as follows:
[0065] The above expression is to divide the samples into two sets at the node: the left subnode and the right subnode, and calculate the G of the two sets respectively. L , H L , G R , H R , and then calculate the gain Gain. Where G L Represents the first-order gradient sum of the set of sample points in the left leaf node if split, G R H represents the right node. L Represents the second-order gradient sum of the set of sample points in the left leaf node. Similarly, H R Represents the sum of the second-order gradients of the set of sample points in the right leaf node.
[0066] When the first tree is built, the division of all samples in the training set is completed and all samples are divided into leaf nodes of the tree. However, it cannot be guaranteed that each sample can get the most accurate prediction at this time, because many samples with different characteristics are divided into the same leaf node. At this time, the model can continue to build the second tree and the third tree. The target value of the second tree is not the original labeled value of the sample, but the predicted value based on the first tree. The residual value from the original target value y When the model selects branch nodes to divide the data set, the left and right subtrees do not affect each other during construction. After division, the training data becomes two subsets with no intersection. They also do not affect each other when selecting the optimal segmentation features and feature values. Therefore, when the model builds the tree, it can generate the left subtree and the right subtree at the same time (parallel calculation), which helps to speed up training.
[0067] The model training process is the process of building trees one by one until all trees are built. Although the construction of each tree is serial, the construction of the left subtree and the right subtree of a tree do not affect each other and can be calculated in parallel until all trees are built.
[0068] Step A3: adjusting the parameters of the regression tree model according to the training results of the training samples.
[0069] Step A4, continue to execute the step of obtaining training samples and the harvest amount corresponding to the training samples until the preset training end condition is met, and determine the trained regression tree model as the trained regression tree model.
[0070] The number of regression trees of the regression tree model in this embodiment is equal to the number threshold; and the change amount of the parameter of the regression tree model is less than the preset change threshold.
[0071] The model training in this embodiment requires multiple iterations. Before building the tree, a hyperparameter K is manually set to represent the total number of subtrees constructed by the scalable regression tree (K is the preset number threshold of the regression tree). K trees are constructed in turn in each round of training. When all K trees are constructed and the model parameters are continuously updated but no longer change or the parameter change is less than a given threshold (ξ=0.0001), it indicates that the training is completed. At this time, the model has converged and can be tested using the validation set.
[0072] After completing the step of training the regression tree model, the present embodiment may further verify the regression tree model, for example, verifying the trained regression tree model based on a preset verification sample.
[0073] After the model converges, the accuracy of the model is tested with the validation set data. The validation set data is also labeled data, which is the remaining 20% of the data when the training set is constructed. The validation phase requires running the prediction results of each tree on the sample to be tested in turn, and accumulating the prediction results of each tree to obtain the final prediction value.
[0074] The crop yield prediction stage is the process of using the trained scalable regression tree model to predict the crop yield. After the model training converges, the fixed model weights remain unchanged, the feature data of the predicted data is preprocessed in the same way, and the processed feature data is input into the model. After the model calculation, the yield of different categories of crops can be output, that is, the crop yield prediction data.
[0075] The above method provided by the embodiment of the present invention can select the branch nodes of the tree according to the calculated gain value Gain, which is conducive to the model's fault-tolerant processing of null values and abnormal values. The scalable regression tree used in this embodiment is a tree model based on serial residual fitting. Since multiple trees are constructed in sequence to fit the training data, the prediction error is continuously reduced, making the model more accurate than other regression models. When this embodiment generates each tree, the left subtree and the right subtree can be generated at the same time. Especially when the tree is deeper, it can be more fully parallelized, which can significantly improve the model training speed.
[0076] Embodiment three:
[0077] Corresponding to the above method embodiment, the present invention provides a crop yield prediction device, see Figure 5 The schematic diagram of the structure of a crop yield prediction device is shown, and the crop yield prediction device comprises:
[0078] A monitoring data acquisition module 51 is used to acquire monitoring data of crops based on a global positioning system, a geographic information system and remote sensing technology;
[0079] The characteristic data determination module 52 is used to determine the characteristic data corresponding to the monitoring data; the characteristic data represents the data that affects the harvest amount of the crop;
[0080] The harvest prediction module 53 is used to input feature data into a pre-trained regression tree model and output crop harvest prediction data; wherein the regression tree model is constructed based on a scalable regression tree algorithm.
[0081] The embodiment of the present invention provides a crop harvest prediction device, which obtains crop monitoring data based on the global positioning system, geographic information system and remote sensing technology, inputs the feature data corresponding to the above monitoring data into a regression tree model constructed based on a scalable regression tree algorithm, and outputs crop harvest prediction data. In this method, the growth data of crops at different stages of their entire life cycle can be monitored through the global positioning system, geographic information system and remote sensing technology. The data used in modeling is comprehensive and the stock is huge, which can maximize the prediction accuracy from the data perspective; the regression tree model is constructed based on the scalable regression tree algorithm, which can simultaneously increase and decrease the amount of data and the amount of calculation, and the model is scalable.
[0082] The above monitoring data include crop growth monitoring data, climate and environment monitoring data, and pest and disease monitoring data; the above monitoring data acquisition module is used to determine the planting area of crops with specified coordinates based on the global positioning system; map the planting area of crops based on the geographic information system and output multiple layers; determine the crop growth monitoring data, climate and environment monitoring data, and pest and disease monitoring data corresponding to multiple layers through remote sensing technology.
[0083] The characteristic data determination module is used to determine the type of data that affects the harvest amount of crops; and extract characteristic data corresponding to the monitoring data from the monitoring data based on the type of data.
[0084] The above-mentioned recovery volume prediction module is used to normalize the characteristic data; the normalized characteristic data is input into the pre-trained regression tree model.
[0085] The above-mentioned device also includes a regression tree model training module, which is used to obtain training samples and the harvest amount corresponding to the training samples; wherein the training samples and the harvest amount corresponding to the training samples are obtained based on historical monitoring data of crops; a regression tree with a preset quantity threshold of the regression tree model is constructed based on the training samples; the parameters of the regression tree model are adjusted according to the training results of the training samples; and the steps of obtaining the training samples and the harvest amount corresponding to the training samples are continued until the preset training end conditions are met, and the trained regression tree model is determined as the trained regression tree model.
[0086] The above regression tree model training module is also used to verify the trained regression tree model based on a preset verification sample.
[0087] The above-mentioned regression tree model training module is also used to determine training samples and verification samples from historical monitoring data of crops based on a preset ratio; wherein the historical monitoring data includes historical characteristic data of crops and the harvest amount corresponding to the historical characteristic data.
[0088] The above-mentioned regression tree model training module is used to calculate the gain value of each feature in the training sample, obtain the target feature corresponding to the maximum gain value; branch nodes are made based on the target feature, the training sample is divided, and the first regression tree of the regression tree model is constructed; wherein the tree height of the first regression tree does not exceed a preset height threshold.
[0089] The above training end conditions include: the number of regression trees of the regression tree model is equal to the number threshold; and the change amount of the parameters of the regression tree model is less than the preset change threshold.
[0090] The crop yield prediction device provided in the embodiment of the present invention has the same implementation principle and technical effects as those in the aforementioned crop yield prediction method embodiment. For the sake of brief description, for matters not mentioned in the crop yield prediction device embodiment, reference may be made to the corresponding contents in the aforementioned crop yield prediction method embodiment.
[0091] Embodiment 4:
[0092] The embodiment of the present invention also provides an electronic device for executing the above-mentioned crop yield prediction method; see Figure 6A structural schematic diagram of an electronic device is shown, which includes a memory 100 and a processor 101, wherein the memory 100 is used to store one or more computer instructions, and the one or more computer instructions are executed by the processor 101 to implement the above-mentioned crop yield prediction method.
[0093] Further, Figure 6 The electronic device shown further includes a bus 102 and a communication interface 103 , and the processor 101 , the communication interface 103 and the memory 100 are connected via the bus 102 .
[0094] The memory 100 may include a high-speed random access memory (RAM), and may also include a non-volatile memory, such as at least one disk storage. The communication connection between the system network element and at least one other network element is realized through at least one communication interface 103 (which may be wired or wireless), and the Internet, wide area network, local area network, metropolitan area network, etc. may be used. The bus 102 may be an ISA bus, a PCI bus, or an EISA bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 Only one bidirectional arrow is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0095] The processor 101 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 101. The above processor 101 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 gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present invention can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly embodied as a hardware decoding processor for execution, or a combination of hardware and software modules in the decoding processor for execution. The software module may be located in a storage medium mature in the art, such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory 100, and the processor 101 reads the information in the memory 100 and completes the steps of the method of the above embodiment in combination with its hardware.
[0096] An embodiment of the present invention also provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions prompt the processor to implement the above-mentioned crop yield prediction method. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0097] The computer program product of the crop harvest prediction method and device provided in the embodiments of the present invention includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the method in the previous method embodiment. The specific implementation can be found in the method embodiment, which will not be repeated here.
[0098] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the system and / or device described above can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0099] In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0100] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, electronic device, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0101] In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicating the orientation or positional relationship, are based on the orientation or positional relationship shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first", "second", and "third" are used for descriptive purposes only, and cannot be understood as indicating or implying relative importance.
[0102] Finally, it should be noted that the above-described embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, rather than to limit them. The protection scope of the present invention is not limited thereto. Although the present invention is described in detail with reference to the above-described embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-described embodiments within the technical scope disclosed by the present invention, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims
1. A method for predicting crop yield, characterized in that: The method comprises: Obtain crop monitoring data based on GPS, GIS and remote sensing technology; Determining characteristic data corresponding to the monitoring data; the characteristic data represents data affecting the harvest amount of the crop; Inputting the characteristic data into a pre-trained regression tree model, and outputting the crop yield prediction data; wherein the regression tree model is constructed based on a scalable regression tree algorithm; The regression tree model is trained by the following steps: Acquire training samples and the harvest amount corresponding to the training samples; wherein the training samples and the harvest amount corresponding to the training samples are acquired based on historical monitoring data of the crops; Constructing a regression tree of a preset number threshold of the regression tree model based on the training samples; Adjusting the parameters of the regression tree model according to the training results of the training samples; Continue to execute the step of obtaining the training samples and the harvest amounts corresponding to the training samples until a preset training end condition is met, and determine the regression tree model obtained by training as the trained regression tree model; The step of constructing a first regression tree of the regression tree model based on the training sample comprises: Calculating the gain value of each feature in the training sample to obtain the target feature corresponding to the maximum value of the gain value; Perform branching nodes based on the target feature, divide the training sample, and construct a first regression tree of the regression tree model; wherein the tree height of the first regression tree does not exceed a preset height threshold; The specific formula of the gain value is as follows: ; represents the gain value, represents the first-order gradient sum of the set of sample points in the left leaf node, represents the first-order gradient sum of the set of sample points in the right leaf node, represents the second-order gradient sum of the set of sample points in the left leaf node, represents the second-order gradient sum of the set of sample points in the right leaf node, represents the leaf tree penalty regularization term; when constructing the first regression tree, the left subtree and the right subtree corresponding to the first regression tree are generated at the same time; The monitoring data include crop growth monitoring data, climate and environment monitoring data, and pest and disease monitoring data; The steps to obtain crop monitoring data based on GPS, GIS and remote sensing technology include: Determine the planting area of the crop at the specified coordinates based on the global positioning system; Processing the planting area of the crop based on a geographic information system to map and output multiple layers; Determine the crop growth monitoring data, the climate environment monitoring data and the pest and disease monitoring data corresponding to the plurality of layers by remote sensing technology; The characteristic data include: crop growth data, climate and environment data, and pest and disease data; The crop growth data include: plot location, plot area, planted crop type, crop variety and plot type; the climate environment data include: monthly average temperature, monthly average humidity, daily maximum light intensity, daily maximum temperature and daily minimum temperature; the pest and disease data include: disease category, pest category, weed category, hazard level and hazard area; the characteristic data covers all aspects of crops from planting, growth, farming operations to harvesting.
2. The method according to claim 1, characterized in that The step of determining characteristic data corresponding to the monitoring data comprises: determining the type of data that affects the yield of the crop; Feature data corresponding to the monitoring data is extracted from the monitoring data based on the type of the data.
3. The method according to claim 1, characterized in that The step of inputting the feature data into a pre-trained regression tree model comprises: Performing normalization processing on the feature data; The normalized feature data is input into a pre-trained regression tree model.
4. The method according to claim 1, characterized in that: After the step of determining the trained regression tree model as the trained regression tree model, the method further includes: The trained regression tree model is verified based on a preset verification sample.
5. The method according to claim 4, characterized in that The method further comprises: Based on a preset ratio, training samples and verification samples are determined from historical monitoring data of the crop; wherein the historical monitoring data includes historical characteristic data of the crop and the harvest amount corresponding to the historical characteristic data.
6. The method according to claim 1, characterized in that The training end condition includes: the number of regression trees of the regression tree model is equal to the number threshold; and the change amount of the parameter of the regression tree model is less than a preset change threshold.
7. A crop yield prediction device, characterized in that: The device is used to implement the crop yield prediction method according to any one of claims 1 to 6, the device comprising: Monitoring data acquisition module, used to obtain crop monitoring data based on global positioning system, geographic information system and remote sensing technology; A characteristic data determination module, used to determine characteristic data corresponding to the monitoring data; the characteristic data represents data affecting the harvest amount of the crop; A harvest prediction module, used to input the feature data into a pre-trained regression tree model and output the crop harvest prediction data; wherein the regression tree model is constructed based on a scalable regression tree algorithm; A regression tree model training module, used for obtaining training samples and the harvest amount corresponding to the training samples; wherein the training samples and the harvest amount corresponding to the training samples are obtained based on the historical monitoring data of the crop; a regression tree of a preset quantity threshold of the regression tree model is constructed based on the training samples; the parameters of the regression tree model are adjusted according to the training results of the training samples; the steps of obtaining the training samples and the harvest amount corresponding to the training samples are continuously executed until a preset training end condition is met, and the regression tree model obtained through training is determined as the trained regression tree model; The regression tree model training module is further used to calculate the gain value of each feature in the training sample, obtain the target feature corresponding to the maximum value of the gain value; perform branching nodes based on the target feature, divide the training sample, and construct the first regression tree of the regression tree model; wherein the tree height of the first regression tree does not exceed a preset height threshold; the specific formula of the gain value is as follows: ; represents the gain value, represents the first-order gradient sum of the set of sample points in the left leaf node, represents the first-order gradient sum of the set of sample points in the right leaf node, represents the second-order gradient sum of the set of sample points in the left leaf node, represents the second-order gradient sum of the set of sample points in the right leaf node, Represents the leaf tree penalty regularization term; when constructing the first regression tree, the left subtree and right subtree corresponding to the first regression tree are generated at the same time.
