A method, system, device and medium for extracting stable pixels of crop rotation
By acquiring images and historical data of the target area, calculating the planting sequence and stability rate, using multiple classifiers to classify crops, and setting accurate probability thresholds, the problem of large crop classification errors in existing technologies is solved and high-precision pixel extraction is achieved.
Patent Information
- Application Number
- CN202411247835.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-06
- Publication Date
- 2025-09-16
- Estimated Expiration
- 2044-09-06
AI Technical Summary
In the existing technology of early crop classification, it is difficult and costly to obtain training samples. Methods based on phenological characteristics or classifier transfer strategies are easily affected by climate change and fog, resulting in large classification errors. The probability threshold setting method of the sample transfer strategy leads to large errors.
By acquiring image data and historical crop planting type data of the target area, the position of each pixel and the corresponding historical crop type data are determined, the planting sequence and crop rotation stability rate are calculated, and classification is performed using multiple pre-trained classifiers. A probability threshold is set to determine crop rotation stable pixels, and an accurate probability threshold is constructed by combining the crop rotation pattern, crop type and stability rate.
It improves the accuracy of crop classification, reduces classification errors, and improves the accuracy and efficiency of pixel extraction.
Smart Images

Figure CN119295914B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a method, system, device and medium for extracting stable pixels of crop rotation. Background Art
[0002] Currently, with the rapid increase in global population, food security has become an important research area in various countries. Among them, timely and accurate acquisition of crop planting information and spatial distribution status is of great significance in the process of assessing food security.
[0003] In supervised learning-based early crop classification research, the quality and quantity of training samples directly impact classification accuracy. Ideally, training samples should be ground-truth data obtained through targeted, first-hand surveys. However, collecting ground-truth samples is difficult and costly. Existing techniques utilize unique early crop phenological characteristics or employ classifier transfer or sample transfer strategies to obtain early crop classification training samples without ground-truth samples.
[0004] In the aforementioned method of using phenological characteristics to obtain training samples, many researchers analyze the unique characteristics of the crops under study to generate classification rules and then construct training samples. However, this method requires high-temporal-resolution remote sensing observation data and also needs to consider issues such as the influence of clouds and fog on optical data, resulting in large classification errors in training samples. The classifier transfer strategy attempts to apply classification rules constructed based on historical years to the target year. However, this assumes that the classification rules remain stable between years and is susceptible to climate change, resulting in increased classification errors. Furthermore, the sample transfer strategy analyzes crop type data from previous years and combines it with crop rotation patterns to provide a certain degree of pre-season prediction of crop planting types and spatial distribution. However, this method relies on a simple "one-size-fits-all" probability threshold setting method for crop classification, resulting in large classification errors. Summary of the Invention
[0005] In order to solve the above technical problems, the present invention discloses a crop rotation stable pixel extraction method, system, equipment and medium for improving the accuracy of crop classification.
[0006] In order to achieve the above objectives, in a first aspect, the present invention discloses a method for extracting stable pixels of crop rotation, comprising:
[0007] Acquiring image data corresponding to the target area and first historical crop planting type data;
[0008] Determining a position corresponding to each pixel in the image data, and re-encoding the first historical crop planting type data according to the position to obtain second historical crop type data corresponding to each pixel;
[0009] determining, based on the second historical crop type data, a plurality of planting sequences corresponding to each crop in the target area and a crop rotation stability rate corresponding to each planting sequence;
[0010] Inputting the second historical crop type data into a plurality of pre-trained classifiers for classification, respectively, to obtain the crop type predicted and outputted by each classifier for each pixel and the classification probability corresponding to the crop type;
[0011] Setting a probability threshold according to the planting sequence, the classification probability and the crop rotation stability rate;
[0012] When the crop types output by each of the classifiers are consistent and each of the classification probabilities is greater than the probability threshold, it is determined that the pixel corresponding to the second historical crop type data currently input to the classifier is a crop rotation stable pixel.
[0013] The present invention discloses a method for extracting stable crop rotation pixels. The method first collects image data and first historical crop planting type data corresponding to a target area, assigns corresponding second historical crop planting type data to the position corresponding to each pixel in the image data, and finally determines whether the pixel is a stable crop rotation pixel based on the second historical crop planting type data corresponding to each pixel, that is, determines whether the crops planted in the area where the pixel is located have a stable crop rotation pattern. After obtaining the second historical crop type data corresponding to each pixel, the method first determines the planting sequence corresponding to the pixel and the crop rotation stability rate corresponding to the planting sequence based on the second historical crop type data. Subsequently, a probability threshold is set in combination with the crop rotation stability rate of each pixel to avoid the technical problem of large classification errors caused by one-size-fits-all threshold setting and improve classification accuracy.
[0014] After calculating the planting sequence and crop rotation stability rate corresponding to each pixel, the corresponding second historical crop type data is input into multiple pre-trained classifiers for classification. The output results of the multiple classifiers are combined to ultimately determine the pixel, thereby improving the accuracy of pixel extraction. After each classifier outputs the classification result for the pixel, a classification probability threshold is set based on the classification result and the crop rotation stability rate. The output of the classifier is then verified for accuracy based on this probability threshold, which takes into account various factors, thereby improving the accuracy of pixel extraction.
[0015] As a preferred example, the step of obtaining image data corresponding to the target area and first historical crop planting type data includes:
[0016] Obtaining a historical annual crop list of a target area, and counting the main planted crop types corresponding to the target area according to the historical annual crop list;
[0017] According to the main crop types, first historical crop planting type data corresponding to the target area is extracted from the historical annual crop list; wherein the first historical crop planting type data includes corn, soybeans, winter wheat, forage grass and others.
[0018] The present invention counts the main planted crop types according to the historical annual crop list, and then selects the corresponding first historical crop planting type data from the historical annual crop list according to the crop type, so as to reduce the amount of data that needs to be processed subsequently and improve the efficiency of pixel extraction.
[0019] As a preferred example, determining, based on the second historical crop type data, a plurality of planting sequences corresponding to each crop in the target area and a crop rotation stability rate corresponding to each planting sequence includes:
[0020] Obtaining, based on the second historical crop type data, the crop type planted in each year for each pixel, sorting the crop types in chronological order, and generating a first planting sequence and a second planting sequence corresponding to each pixel; wherein the second planting sequence includes the first planting sequence;
[0021] Obtaining a first number corresponding to the pixels having the first planting sequence and a second number corresponding to the pixels having the second planting sequence;
[0022] A ratio of the first quantity to the second quantity is calculated, and the ratio is used as a crop rotation stability rate corresponding to the first planting sequence.
[0023] The present invention sorts the crop types planted in each year according to the time series to generate a first planting sequence and a second planting sequence including the first planting sequence, and determines the crop rotation stability rate of the first planting sequence according to the ratio of the second planting sequence to the first planting sequence. Subsequently, a corresponding probability threshold is set in combination with the crop rotation stability rate to ensure that the probability threshold conforms to the crop rotation law of the target area, thereby improving the accuracy of subsequent pixel extraction based on the precise probability threshold.
[0024] As a preferred example, obtaining the crop type predicted and output by each classifier for each pixel and the classification probability corresponding to the crop type includes:
[0025] inputting the second historical crop type data into a pre-trained first classifier based on a multi-layer perceptron, a second classifier based on a random forest, and a third classifier based on extreme gradient boosting;
[0026] learning a crop rotation pattern corresponding to the second historical crop type data using the first classifier, so as to predict a first crop type corresponding to the pixel and a first classification probability corresponding to the first crop type according to the crop rotation pattern;
[0027] learning a crop rotation pattern corresponding to the second historical crop type data using the second classifier, so as to predict a second crop type corresponding to the pixel and a second classification probability corresponding to the second crop type according to the crop rotation pattern;
[0028] The crop rotation law corresponding to the second historical crop type data is learned by the third classifier to predict the third crop type corresponding to the pixel and the third classification probability corresponding to the third crop type according to the crop rotation law.
[0029] The present invention sets up a plurality of different classifiers to respectively predict the input second historical crop type data, and then combines the output results of the plurality of classifiers to ensure the accuracy of the pixel classification.
[0030] As a preferred example, the setting of the probability threshold according to the planting sequence, the classification probability and the crop rotation stability rate includes:
[0031] Obtaining a crop rotation stability rate corresponding to the second planting sequence and the first planting sequence for each pixel;
[0032] Determining a crop rotation pattern corresponding to each pixel according to the second planting sequence; wherein the crop rotation pattern is constructed based on corn, soybeans, winter wheat and forage grass;
[0033] The probability threshold is constructed in combination with the crop rotation pattern, the classification probability corresponding to the crop type, and the crop rotation stability rate.
[0034] The present invention sets the probability threshold corresponding to the pixel in combination with the crop rotation pattern, the classification probability corresponding to the crop type and the crop rotation stability rate, so that the set probability threshold conforms to the crop rotation law of the pixel, thereby improving the flexibility and accuracy of the probability threshold setting and improving the accuracy of the pixel classification through the high-precision probability threshold.
[0035] As a preferred example, when the crop types output by each of the classifiers are consistent and each of the classification probabilities is greater than the probability threshold, determining that the pixel corresponding to the second historical crop type data currently input to the classifier is a crop rotation stable pixel includes:
[0036] comparing the first crop type, the second crop type, and the third crop type to determine whether the crop types output by each of the classifiers are consistent;
[0037] When it is determined that the crop types are consistent, comparing the first classification probability, the second classification probability, and the third classification probability with the probability threshold respectively;
[0038] When the first classification probability, the second classification probability and the third classification probability are all greater than the probability threshold, the pixel corresponding to the second historical crop type data currently input into the classifier is determined to be a crop rotation stable pixel, and the crop type corresponding to the pixel and the classification probability corresponding to the crop type are output.
[0039] The present invention integrates the classification results output by multiple classifiers through a unanimous voting method. Only when the crop types output by the classifiers are consistent and the classification probability of the crop type output by each classifier is greater than the probability threshold, the pixel currently input to the classifier is determined to be a crop rotation stable pixel, thereby improving the accuracy of pixel extraction.
[0040] In a second aspect, the present invention discloses a crop rotation stable pixel extraction system, comprising a data acquisition module, a data matching module, a crop rotation calculation module, a crop prediction module, a probability setting module, and a pixel extraction module;
[0041] The data acquisition module is used to obtain image data corresponding to the target area and first historical crop planting type data;
[0042] The data matching module is used to determine the position corresponding to each pixel in the image data, and re-encode the first historical crop planting type data according to the position to obtain the second historical crop type data corresponding to each pixel;
[0043] The crop rotation calculation module is used to determine a plurality of planting sequences corresponding to each crop in the target area and a crop rotation stability rate corresponding to each planting sequence according to the second historical crop type data;
[0044] The crop prediction module is used to input the second historical crop type data into a plurality of pre-trained classifiers for classification, and obtain the crop type predicted and output by each classifier for each pixel and the classification probability corresponding to the crop type;
[0045] The probability setting module is used to set a probability threshold according to the planting sequence, the classification probability and the crop rotation stability rate;
[0046] The pixel extraction module is used to determine that the pixel corresponding to the second historical crop type data currently input to the classifier is a crop rotation stable pixel when the crop type output by each classifier is consistent and each classification probability is greater than the probability threshold.
[0047] The present invention discloses a crop rotation stability pixel extraction system, which first collects image data and first historical crop planting type data corresponding to a target area, and assigns corresponding second historical crop planting type data to the position corresponding to each pixel in the image data. Finally, based on the second historical crop planting type data corresponding to each pixel, it is determined whether the pixel is a crop rotation stability pixel, that is, whether the crops planted in the area where the pixel is located have a stable crop rotation pattern. After obtaining the second historical crop type data corresponding to each pixel, the planting sequence corresponding to the pixel and the crop rotation stability rate corresponding to the planting sequence are first determined based on the second historical crop type data. Subsequently, a probability threshold is set in combination with the crop rotation stability rate of each pixel to avoid the technical problem of large classification errors caused by one-size-fits-all threshold setting, thereby improving classification accuracy.
[0048] After calculating the planting sequence and crop rotation stability rate corresponding to each pixel, the corresponding second historical crop type data is input into multiple pre-trained classifiers for classification. The output results of the multiple classifiers are combined to ultimately determine the pixel, thereby improving the accuracy of pixel extraction. After each classifier outputs the classification result for the pixel, a classification probability threshold is set based on the classification result and the crop rotation stability rate. The output of the classifier is then verified for accuracy based on this probability threshold, which takes into account various factors, thereby improving the accuracy of pixel extraction.
[0049] As a preferred example, the data collection module includes a crop statistics unit and a data extraction unit;
[0050] The crop statistics unit is used to obtain a historical annual crop list of the target area, so as to count the main planted crop types corresponding to the target area according to the historical annual crop list;
[0051] The data extraction unit is used to extract the first historical crop planting type data corresponding to the target area from the historical annual crop list based on the main planted crop type; wherein the first historical crop planting type data includes corn, soybeans, winter wheat, forage and others.
[0052] The present invention counts the main planted crop types according to the historical annual crop list, and then selects the corresponding first historical crop planting type data from the historical annual crop list according to the crop type, so as to reduce the amount of data that needs to be processed subsequently and improve the efficiency of pixel extraction.
[0053] In a third aspect, the present invention further discloses an electronic device comprising: at least one processor, and a memory communicatively connected to at least one of the processors; wherein the memory stores instructions, and the instructions are executed by at least one of the processors, so that when at least one of the processors executes the instructions, a method for crop rotation stable pixel extraction as described in the first aspect is implemented.
[0054] In a fourth aspect, the present invention further discloses a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the crop rotation stable pixel extraction method as described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 : A schematic flow chart of a method for extracting stable pixels of crop rotation disclosed in an embodiment of the present invention;
[0056] Figure 2 : A structural diagram of a crop rotation stable pixel extraction system disclosed in an embodiment of the present invention;
[0057] Figure 3 : A flow chart of a crop rotation stable pixel extraction method disclosed in another embodiment of the present invention. DETAILED DESCRIPTION
[0058] The following will provide a clear and complete description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0059] Example 1
[0060] This embodiment discloses a method for extracting stable pixels from crop rotation. For details, please refer to the specific implementation process of the pixel extraction method. Figure 1 , mainly including steps 101 to 106, wherein the steps are mainly:
[0061] Step 101: Acquire image data corresponding to a target area and first historical crop planting type data.
[0062] In this embodiment, this step mainly includes: obtaining the historical annual crop list of the target area, and counting the main planted crop types corresponding to the target area based on the historical annual crop list; according to the main planted crop types, extracting the first historical crop planting type data corresponding to the target area from the historical annual crop list; wherein, the first historical crop planting type data includes corn, soybeans, winter wheat, forage and others.
[0063] In this embodiment, this step counts the main planted crop types based on the historical annual crop list, and then selects the corresponding first historical crop planting type data from the historical annual crop list based on the crop type, so as to reduce the amount of data that needs to be processed subsequently and improve the efficiency of pixel extraction.
[0064] Step 102: Determine the position corresponding to each pixel in the image data, and re-encode the first historical crop planting type data according to the position to obtain the second historical crop type data corresponding to each pixel.
[0065] Step 103: Determine, based on the second historical crop type data, a number of planting sequences corresponding to each crop in the target area and a crop rotation stability rate corresponding to each planting sequence.
[0066] In this embodiment, this step mainly includes: obtaining the crop type planted for each pixel in each year based on the second historical crop type data, sorting the crop types in chronological order, and generating a first planting sequence and a second planting sequence corresponding to each pixel; wherein the second planting sequence includes the first planting sequence; obtaining a first number corresponding to the pixels with the first planting sequence and a second number corresponding to the pixels with the second planting sequence; calculating the ratio of the first number to the second number, and using the ratio as the crop rotation stability rate corresponding to the first planting sequence.
[0067] In this embodiment, this step sorts the crop types planted in each year according to the time series to generate a first planting sequence and a second planting sequence including the first planting sequence, and determines the crop rotation stability rate of the first planting sequence based on the ratio of the second planting sequence to the first planting sequence, and then sets the corresponding probability threshold based on the crop rotation stability rate to ensure that the probability threshold conforms to the crop rotation law of the target area, and then improves the accuracy of subsequent pixel extraction based on the precise probability threshold.
[0068] Step 104: Input the second historical crop type data into a plurality of pre-trained classifiers for classification, and obtain the crop type predicted and output by each classifier for each pixel and the classification probability corresponding to the crop type.
[0069] In this embodiment, this step mainly includes: inputting the second historical crop type data into a pre-trained first classifier constructed based on a multi-layer perceptron, a second classifier constructed based on a random forest, and a third classifier constructed based on extreme gradient boosting; learning the crop rotation law corresponding to the second historical crop type data through the first classifier, so as to predict the first crop type corresponding to the pixel and the first classification probability corresponding to the first crop type according to the crop rotation law; learning the crop rotation law corresponding to the second historical crop type data through the second classifier, so as to predict the second crop type corresponding to the pixel and the second classification probability corresponding to the second crop type according to the crop rotation law; learning the crop rotation law corresponding to the second historical crop type data through the third classifier, so as to predict the third crop type corresponding to the pixel and the third classification probability corresponding to the third crop type according to the crop rotation law.
[0070] In this embodiment, this step sets a plurality of different classifiers to respectively predict the input second historical crop type data, and then combines the output results of the plurality of classifiers to ensure the accuracy of the pixel classification.
[0071] Step 105: setting a probability threshold according to the planting sequence, the classification probability and the crop rotation stability rate.
[0072] In this embodiment, this step mainly includes: obtaining the second planting sequence corresponding to each pixel and the crop rotation stability rate corresponding to the first planting sequence; determining the crop rotation pattern corresponding to each pixel according to the second planting sequence; wherein the crop rotation pattern is constructed based on corn, soybeans, winter wheat and forage grass; and constructing the probability threshold in combination with the crop rotation pattern, the classification probability corresponding to the crop type and the crop rotation stability rate.
[0073] In this embodiment, this step sets the probability threshold corresponding to the pixel in combination with the crop rotation pattern, the classification probability corresponding to the crop type and the crop rotation stability rate, so that the set probability threshold conforms to the crop rotation law of the pixel, thereby improving the flexibility and accuracy of the probability threshold setting and improving the accuracy of the pixel classification through the high-precision probability threshold.
[0074] Step 106: When the crop types output by each classifier are consistent and each classification probability is greater than the probability threshold, it is determined that the pixel corresponding to the second historical crop type data currently input to the classifier is a crop rotation stable pixel.
[0075] In this embodiment, this step mainly includes: comparing the first crop type, the second crop type and the third crop type to determine whether the crop types output by each of the classifiers are consistent; when it is determined that the crop types are consistent, comparing the first classification probability, the second classification probability and the third classification probability with the probability threshold respectively; when the first classification probability, the second classification probability and the third classification probability are all greater than the probability threshold, determining that the pixel corresponding to the second historical crop type data currently input to the classifier is a crop rotation stable pixel, and outputting the crop type corresponding to the pixel and the classification probability corresponding to the crop type.
[0076] In this embodiment, this step integrates the classification results output by multiple classifiers through a unanimous voting method. Only when the crop types output by the classifiers are consistent and the classification probability of the crop types output by each classifier is greater than the probability threshold, the pixel currently input to the classifier is determined to be a crop rotation stable pixel, thereby improving the accuracy of pixel extraction.
[0077] In the second aspect, this embodiment also discloses a crop rotation stable pixel extraction system. The specific structure of the pixel extraction system is shown in FIG. Figure 2 , including a data acquisition module 201, a data matching module 202, a crop rotation calculation module 203, a crop prediction module 204, a probability setting module 205 and a pixel extraction module 206.
[0078] The data acquisition module 201 is used to obtain image data corresponding to the target area and first historical crop planting type data.
[0079] The data matching module 202 is used to determine the position corresponding to each pixel in the image data, and re-encode the first historical crop planting type data according to the position to obtain the second historical crop type data corresponding to each pixel.
[0080] The crop rotation calculation module 203 is configured to determine a plurality of planting sequences corresponding to each crop in the target area and a crop rotation stability rate corresponding to each planting sequence according to the second historical crop type data.
[0081] The crop prediction module 204 is used to input the second historical crop type data into multiple pre-trained classifiers for classification, and obtain the crop type predicted and output by each classifier for each pixel and the classification probability corresponding to the crop type.
[0082] The probability setting module 205 is used to set a probability threshold according to the planting sequence, the classification probability and the crop rotation stability rate.
[0083] The pixel extraction module 206 is configured to determine that a pixel corresponding to the second historical crop type data currently input to the classifier is a crop rotation stable pixel when the crop types output by each classifier are consistent and each classification probability is greater than the probability threshold.
[0084] In this embodiment, the data collection module 201 includes a crop statistics unit and a data extraction unit.
[0085] The crop statistics unit is used to obtain a historical annual crop list of a target area, so as to count the main planted crop types corresponding to the target area according to the historical annual crop list.
[0086] The data extraction unit is used to extract the first historical crop planting type data corresponding to the target area from the historical annual crop list based on the main planted crop type; wherein the first historical crop planting type data includes corn, soybeans, winter wheat, forage and others.
[0087] In this embodiment, in addition to the above-mentioned method and system, an electronic device and a computer storage medium are also provided, wherein the electronic device includes at least one processor, and a memory communicatively connected to at least one of the processors; wherein the memory stores instructions, and the instructions are executed by at least one of the processors so that when at least one of the processors executes the instructions, a method for extracting stable pixels from crop rotation as described in this embodiment is implemented; and the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute a method for extracting stable pixels from crop rotation as described in this embodiment.
[0088] Example 2
[0089] This embodiment further provides a method for extracting stable pixels of crop rotation. Specifically, the implementation process of the extraction method can refer to Figure 3 , including steps 301 to 304, wherein the steps are mainly:
[0090] Step 301: Obtain an annual crop list and image data of a target area, and obtain historical crop type data corresponding to each pixel in the image data based on the annual crop list.
[0091] In this embodiment, this step mainly includes: obtaining a historical annual crop list of the target area to count the main planted crop types corresponding to the target area based on the historical annual crop list; extracting the first historical crop planting type data corresponding to the target area from the historical annual crop list based on the main planted crop types, and then determining the position corresponding to each pixel in the image data, and obtaining the second historical crop type data corresponding to each pixel from the first historical crop planting type data based on the position.
[0092] Specifically, first, image data corresponding to the target area and ACI data and annual crop list data corresponding to each of the previous years are obtained, and then the ACI data corresponding to the most recent year are obtained to determine the main crop types planted in the target area based on the ACI data. In one application example, ACI data of the target area from 2011 to 2021 are obtained, and then the proportion of different landform types in 2021 is statistically analyzed based on the ACI data. If the statistical result shows that the landforms with the largest proportion in the target area are corn, soybeans, forage, broad-leaved forests, winter wheat, and other categories (such as other crops, buildings, water bodies, etc.), then the main crop types corresponding to the target area are determined to be corn, soybeans, winter wheat, and forage.
[0093] Furthermore, based on the crop type determined above and the position of each pixel in the image data in the target area, the crop type planted for the pixel in each year is extracted from the ACI data from 2011 to 2021 according to the position, so as to generate historical crop type data corresponding to the pixel based on the crop type.
[0094] Step 302: Determine several crop planting sequences corresponding to the target area and the crop rotation stability rate corresponding to each of the crop planting sequences based on the historical crop type data.
[0095] In this embodiment, this step mainly includes: obtaining the crop type planted for each pixel in each year based on the second historical crop type data, sorting the crop types in chronological order, generating a first planting sequence and a second planting sequence corresponding to each pixel, and calculating the ratio of the first quantity corresponding to the first planting sequence to the second quantity corresponding to the second planting sequence, so as to use the ratio as the crop rotation stability rate corresponding to each of the crop planting sequences.
[0096] Specifically, in this embodiment, a crop planting sequence corresponding to each pixel is formed based on the crops planted in each year. For example, in the ACI data for 2011-2021, if a pixel in the ACI data for 2011-2021 was planted with soybeans, corn, soybeans, corn, soybeans, corn, and soybeans, in that order from 2012 to 2018, the first planting sequence corresponding to the pixel is soybeans-corn-soybeans-corn-soybeans-corn-soybeans. Next, the crop type planted for the pixel in 2019 is obtained. If the crop type is corn, the second planting sequence corresponding to the pixel is soybeans-corn-soybeans-corn-soybeans-corn-soybeans-corn-soybeans-corn.
[0097] Next, a first number of samples having the first planting sequence among the pixels corresponding to the target area is calculated. Pixels that still plant corn in the year following the first planting sequence to form the second planting sequence are pixels that meet the requirements of crop rotation stability. At this time, a second number of pixels corresponding to the second planting sequence is calculated. Based on the first number and the second number, a crop rotation stability rate corresponding to the first planting sequence or the second planting sequence is calculated using a preset crop rotation stability rate calculation formula; wherein the crop rotation stability rate calculation formula is: Ns represents the number of pixels with a stable crop rotation pattern, and Nt represents the total number of pixels that conform to this planting sequence.
[0098] In this application example, if there are 362 pixels with the first cropping sequence and a total of 330 pixels still planted with corn in the following year, then the crop rotation stability rate of this cropping sequence is 91.16%. A higher stability rate means that for this crop cropping sequence, there is a higher probability that it will be planted according to this rotation pattern within the study area, and this rotation pattern is more stable. The crop rotation stability rate can reflect the stability of a specific cropping sequence in a certain area. The value of this indicator ranges from 0 to 1. The closer the value is to 1, the higher the stability of the cropping sequence in the sample dataset. This makes it easier to extract highly reliable crop rotation stability pixels in actual pre-season crop predictions.
[0099] Step 303: Input the historical crop type data into a pre-trained ensemble learning model based on multiple classifiers for classification, and obtain the classification results of each classifier for each pixel.
[0100] In this embodiment, this step mainly includes: inputting the second historical crop type data into a pre-trained first classifier constructed based on a multi-layer perceptron, a second classifier constructed based on a random forest, and a third classifier constructed based on extreme gradient boosting, so as to output the corresponding crop type and classification probability through different classifiers.
[0101] Specifically, we first selected three classifiers: a multi-layer perceptron, a random forest, and extreme gradient boosting to form an ensemble learning model for pixel classification. Next, we trained the model and used grid optimization during the training process to select the optimal parameter combination for each classifier. For more information, see Table 1:
[0102]
[0103]
[0104] Furthermore, the training process of the ensemble learning model is as follows:
[0105] 1) Data collection and preprocessing: The ACI data of the previous years (set to collect data from 2011 to 2020) in the study area were obtained and reclassified. The pixel numbered 147 in the ACI data was classified as corn and renumbered as 1; the pixel numbered 158 was soybean and renumbered as 2; the pixels numbered 132, 140 and 145 were classified as winter wheat and renumbered as 3; the pixel numbered 122 was forage grass and renumbered as 4; all other crops and non-agricultural areas were classified as other crops and renumbered as 5.
[0106] 2) Construct a training dataset and a test set. All pixels within the study area were selected as test samples, with each sample's features consisting of the crop type from 2014 to 2020. A random sampling strategy was used to select 0.25% of the pixels within the study area as training samples. Specifically, pixels representing corn, soybeans, winter wheat, pasture, and other landforms from the 2019 and 2020 ACI data were selected as training data labels for the ensemble model, with their features consisting of crop type data from the previous seven years. For example, if a training sample's label is corn from 2019, and its features are the crop types for that pixel from 2012 to 2018 (soybean, corn, soybean, corn, soybean, corn, soybean, respectively), then this training sample is represented as 2-1-2-1-2-1-2-1, where the last 1 is the training set label and the first seven digits are the training set features. Two years of ACI data were selected as training sample labels because the crop planting sequences collected from a single year may not fully cover the crop rotation of different crops. However, crop planting sequences from different years can help the model better adapt to the planting patterns of farmland in different years and improve the model's generalization ability on unknown samples.
[0107] 3) Setting the probability threshold of the model; first, using the same calculation method, the rotation stability rate corresponding to each rotation pattern, i.e., the planting sequence, in the training samples was statistically analyzed, and then the rotation patterns were ranked to determine the more stable rotation pattern in the study area; second, the probability threshold was determined based on the output results of each classifier in the model and the rotation stability rate.
[0108] During the aforementioned probability threshold setting process, each classifier outputs a crop type map (i.e., possible crop types) and a probability map (the distribution probability associated with each crop type). The type map is similar to the ACI data, while each pixel in the probability map represents the predicted probability for each test sample based on the output of predict_proba(). Specifically, it returns an array with each row representing a test sample and each column representing the probability of that sample belonging to a particular class. The class with the highest probability in each row is the predicted classification result for that test sample. For example, if a pixel is classified as corn, the model outputs a "1" with an 88% probability, indicating an 88% certainty that the pixel is corn. Next, the crop type for this pixel is queried in the ACI data from 2014 to 2020 to generate a crop planting sequence. The crop rotation stability rate that matches this crop planting sequence is then calculated for the training samples. Finally, according to the prediction results, the three indicators of crop rotation pattern, classification probability and rotation stability rate were calculated for the four crops of corn, soybean, winter wheat and forage respectively. Finally, an optimal probability threshold that can effectively filter out the stable rotation pattern was comprehensively selected.
[0109] The trained models were then subjected to accuracy verification, comparing the classification accuracy of the single model to the ensemble learning model, as shown in Table 2. Table 2 summarizes the accuracy performance of the MLP, XGBoost, RF, and ensemble learning models on different crops, specifically including the F1-score, Kappa coefficient, and Overall Accuracy (OA) metrics. The results show that the ensemble learning model outperformed the single model in all accuracy metrics for all crops, demonstrating its significant advantages in improving classification accuracy and stability. Specifically, Table 2 is as follows:
[0110]
[0111] Table 2 summarizes the accuracy performance of MLP, XGBoost, RF, and ensemble learning models on different crops, specifically including three indicators: F1-score, Kappa coefficient, and overall accuracy (OA). The results show that the ensemble learning model outperforms the single model in all accuracy indicators on all crops, demonstrating its significant advantages in improving classification accuracy and stability.
[0112] Secondly, to explore the model's cross-temporal applicability, we mapped crop rotation stability pixels for 2020 and 2021 and verified its accuracy using ground truth data from those years. As shown in Table 3, the model achieved high overall classification accuracy in both 2020 and 2021, exceeding 90%. The classification performance for soybeans and winter wheat was particularly good, with F1 scores of 0.94 and 0.91, respectively. However, the F1 scores for corn and forage grasses were relatively low, at 0.90 and 0.89, respectively.
[0113]
[0114]
[0115] Step 304: Based on the classification result and the crop rotation stability rate, a corresponding probability threshold is calculated by a probability threshold calculation method preset in the integrated learning model, and crop rotation stability pixels in the image data are extracted based on the probability threshold and the classification result.
[0116] In this embodiment, this step mainly includes: obtaining the second planting sequence corresponding to each pixel and the crop rotation stability rate corresponding to the first planting sequence; determining the crop rotation pattern corresponding to each pixel according to the second planting sequence; wherein the crop rotation pattern is constructed based on corn, soybeans, winter wheat and forage grass; and constructing the probability threshold in combination with the crop rotation pattern, the classification probability corresponding to the crop type and the crop rotation stability rate.
[0117] Specifically, during the training process of the model, the model is set to calculate the probability threshold corresponding to the current pixel according to the output result of the classifier, the planting sequence corresponding to the pixel, and the crop rotation stability rate corresponding to the sequence.
[0118] After calculating the probability threshold, specifically, the classification result of each classifier in the model for the current input pixel is obtained, where the classification result includes the predicted crop type and the classification probability corresponding to the crop classification. First, it is determined whether the crop types predicted by each classifier are consistent. When the crop types are consistent, the classification probability output by each classifier is then compared with the probability threshold. When the classification probability output by each classifier is greater than the probability threshold, the current input pixel is determined to be a crop rotation stable pixel.
[0119] This embodiment discloses a method for extracting stable crop rotation pixels. By developing a new indicator—the crop rotation stability rate—and setting an optimal probability threshold, an ensemble learning model is constructed by combining three classifiers: a multilayer perceptron, a random forest, and extreme gradient boosting. This model uses a unanimous voting method to select stable crop rotation pixels, effectively filtering out unstable classification results and improving the overall classification stability and accuracy.
[0120] Furthermore, the method proposed in this example utilizes an ensemble learning model composed of multiple classifiers (MLP, random forest, and XGBoost) combined with consensus voting to screen for rotation-stable pixels. This multi-model fusion improves the robustness of the classification results, reduces the bias and error that could be introduced by a single model, and thus enhances overall classification performance.
[0121] Furthermore, when calculating the probability threshold, a classification probability distribution map was constructed by calculating the crop rotation stability rate (RSR) and combining it with the classification probability output by the classifier, so as to determine the optimal classification probability threshold and ensure that the screened crop rotation stability pixels have high reliability.
[0122] The specific embodiments described above further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A method for extracting stable pixels of crop rotation, characterized in that: include: Acquiring image data corresponding to the target area and first historical crop planting type data; Determining a position corresponding to each pixel in the image data, and re-encoding the first historical crop planting type data according to the position to obtain second historical crop type data corresponding to each pixel; Determine, based on the second historical crop type data, several planting sequences corresponding to each crop in the target area and a crop rotation stability rate corresponding to each planting sequence; wherein, based on the second historical crop type data, obtain the crop type planted for each pixel in each year, so as to sort the crop types in chronological order and generate a first planting sequence and a second planting sequence corresponding to each pixel; wherein the second planting sequence includes the first planting sequence; obtain a first number corresponding to the pixels having the first planting sequence and a second number corresponding to the pixels having the second planting sequence; calculate a ratio of the first number to the second number, and use the ratio as the crop rotation stability rate corresponding to the first planting sequence; Inputting the second historical crop type data into a plurality of pre-trained classifiers for classification, respectively, to obtain the crop type predicted and outputted by each classifier for each pixel and the classification probability corresponding to the crop type; Setting a probability threshold according to the planting sequence, the classification probability and the crop rotation stability rate; When the crop types output by each of the classifiers are consistent and each of the classification probabilities is greater than the probability threshold, it is determined that the pixel corresponding to the second historical crop type data currently input to the classifier is a crop rotation stable pixel.
2. The method for extracting stable crop rotation pixels according to claim 1, wherein: The acquiring of image data corresponding to the target area and first historical crop planting type data includes: Obtaining a historical annual crop list of a target area, and counting the main planted crop types corresponding to the target area according to the historical annual crop list; According to the main crop types, first historical crop planting type data corresponding to the target area is extracted from the historical annual crop list; wherein the first historical crop planting type data includes corn, soybeans, winter wheat, forage grass and others.
3. The method for extracting stable crop rotation pixels according to claim 1, wherein: The obtaining of the crop type predicted and output by each classifier for each pixel and the classification probability corresponding to the crop type includes: inputting the second historical crop type data into a pre-trained first classifier based on a multi-layer perceptron, a second classifier based on a random forest, and a third classifier based on extreme gradient boosting; learning a crop rotation pattern corresponding to the second historical crop type data using the first classifier, so as to predict a first crop type corresponding to the pixel and a first classification probability corresponding to the first crop type according to the crop rotation pattern; learning a crop rotation pattern corresponding to the second historical crop type data using the second classifier, so as to predict a second crop type corresponding to the pixel and a second classification probability corresponding to the second crop type according to the crop rotation pattern; The crop rotation law corresponding to the second historical crop type data is learned by the third classifier to predict the third crop type corresponding to the pixel and the third classification probability corresponding to the third crop type according to the crop rotation law.
4. The method for extracting stable crop rotation pixels according to claim 1, wherein: The setting of the probability threshold according to the planting sequence, the classification probability and the crop rotation stability rate includes: Obtaining a crop rotation stability rate corresponding to the second planting sequence and the first planting sequence for each pixel; Determining a crop rotation pattern corresponding to each pixel according to the second planting sequence; wherein the crop rotation pattern is constructed based on corn, soybeans, winter wheat and forage grass; The probability threshold is constructed in combination with the crop rotation pattern, the classification probability corresponding to the crop type, and the crop rotation stability rate.
5. The method for extracting stable pixels of crop rotation according to claim 3, characterized in that: When the crop types output by each of the classifiers are consistent and each of the classification probabilities is greater than the probability threshold, determining that the pixel corresponding to the second historical crop type data currently input to the classifier is a crop rotation stable pixel includes: comparing the first crop type, the second crop type, and the third crop type to determine whether the crop types output by each of the classifiers are consistent; When it is determined that the crop types are consistent, comparing the first classification probability, the second classification probability, and the third classification probability with the probability threshold respectively; When the first classification probability, the second classification probability and the third classification probability are all greater than the probability threshold, the pixel corresponding to the second historical crop type data currently input into the classifier is determined to be a crop rotation stable pixel, and the crop type corresponding to the pixel and the classification probability corresponding to the crop type are output.
6. A crop rotation stable pixel extraction system, characterized in that: It includes data acquisition module, data matching module, crop rotation calculation module, crop prediction module, probability setting module and pixel extraction module; The data acquisition module is used to obtain image data corresponding to the target area and first historical crop planting type data; The data matching module is used to determine the position corresponding to each pixel in the image data, and re-encode the first historical crop planting type data according to the position to obtain the second historical crop type data corresponding to each pixel; The crop rotation calculation module is used to determine a number of planting sequences corresponding to each crop in the target area and a crop rotation stability rate corresponding to each planting sequence based on the second historical crop type data; wherein, based on the second historical crop type data, the crop type planted for each pixel in each year is obtained, so as to sort the crop types according to chronological order and generate a first planting sequence and a second planting sequence corresponding to each pixel; wherein the second planting sequence includes the first planting sequence; obtain a first number corresponding to the pixels having the first planting sequence and a second number corresponding to the pixels having the second planting sequence; calculate a ratio of the first number to the second number, and use the ratio as the crop rotation stability rate corresponding to the first planting sequence; The crop prediction module is used to input the second historical crop type data into a plurality of pre-trained classifiers for classification, and obtain the crop type predicted and output by each classifier for each pixel and the classification probability corresponding to the crop type; The probability setting module is used to set a probability threshold according to the planting sequence, the classification probability and the crop rotation stability rate; The pixel extraction module is used to determine that the pixel corresponding to the second historical crop type data currently input to the classifier is a crop rotation stable pixel when the crop type output by each classifier is consistent and each classification probability is greater than the probability threshold.
7. The crop rotation stable pixel extraction system according to claim 6, characterized in that: The data collection module includes a crop statistics unit and a data extraction unit; The crop statistics unit is used to obtain a historical annual crop list of the target area, so as to count the main planted crop types corresponding to the target area according to the historical annual crop list; The data extraction unit is used to extract the first historical crop planting type data corresponding to the target area from the historical annual crop list based on the main planted crop type; wherein the first historical crop planting type data includes corn, soybeans, winter wheat, forage and others.
8. An electronic device, characterized in that: include: At least one processor, and a memory communicatively connected to the at least one processor; wherein the memory stores instructions, and the instructions are executed by the at least one processor so that when the at least one processor executes the instructions, a crop rotation stable pixel extraction method as described in any one of claims 1 to 5 is implemented.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the crop rotation stable pixel extraction method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Fallow crop rotation information remote sensing identification method and system for winter wheat historical planting area
CN110909679A
Remote sensing identification method for crop types in growing season in combination with crop rotation
CN116912712A