Rotation stable pixel extraction method, system, equipment and medium

By acquiring and analyzing the image and historical planting data of crops, combining the output results of multiple classifiers and the rotation stability rate to set the probability threshold, the problems of difficulty in collecting ground samples and large classification errors in early crop classification are solved, and classification accuracy is improved and efficiency.

CN119295914AActive Publication Date: 2025-01-10SUN YAT SEN UNIV
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411247835.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-06
Publication Date
2025-01-10
Estimated Expiration
2044-09-06

AI Technical Summary

Technical Problem

In the early classification of crops, the collection of real ground samples is difficult and costly, and methods based on phenological characteristics or classifier transfer strategies are susceptible to climate change and clouds, resulting in large classification errors, and simple probability threshold settings lead to classification. Error increases.

Method used

By obtaining the image data of the target area and historical crop planting type data, the planting sequence and crop rotation stability rate of each pixel are determined, and the probability threshold is set based on the output results of multiple pre-trained classifiers and crop rotation stability rate to determine whether the pixel is crop rotation stable. Pixels to improve classification accuracy.

Benefits of technology

It effectively avoids classification errors caused by the one-size-fits-all threshold setting, improves the accuracy and efficiency of crop classification, and enhances the accuracy of pixel extraction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295914A_ABST
    Figure CN119295914A_ABST
Patent Text Reader

Abstract

The invention discloses a crop rotation stable pixel extraction method, system and device and a medium, and the method comprises the steps: obtaining image data of a target region and first historical crop planting type data, according to the position of each pixel in the image data, performing recoding from the first historical crop planting type data to obtain second historical crop type data corresponding to each pixel, so as 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; inputting the second historical crop type data into a plurality of pre-trained classifiers for classification, and obtaining a crop type and a classification probability output by each classifier for predicting each pixel; setting a probability threshold according to the planting sequence, the classification probability and the crop rotation stability; and when the crop types output by the classifiers are consistent and each classification probability is greater than a probability threshold, judging that the pixels currently input into the classifiers are rotation stable pixels, so that the classification accuracy is improved.
Need to check novelty before this filing date? Find Prior Art

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] At present, with the rapid increase of global population, food security has become an important research field 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 the study of early crop classification based on supervised learning, the quality and quantity of training samples will directly affect the accuracy of crop classification. Ideally, the training samples should be ground truth data obtained through surveys that collect targeted first-hand information, but ground truth samples are difficult to collect and costly. In this regard, the existing technology uses the unique phenological characteristics of early crops or adopts classifier transfer strategies or sample transfer strategies to obtain early crop classification training samples without ground truth samples.

[0004] In the above-mentioned method of obtaining training samples using phenological characteristics, based on the unique phenological characteristics of different crops, many researchers generate classification rules and then construct training samples by analyzing the unique characteristics of the crops under study. However, this method requires remote sensing observation data with high temporal resolution, 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 the classification rules constructed based on historical years to the target year, but this is based on the assumption that the classification rules remain stable between different years and are easily affected by climate change, resulting in increased classification errors. Furthermore, the sample transfer strategy analyzes the crop type data of previous years and combines the crop rotation rules to predict the planting type and spatial distribution of crops to a certain extent before the season. However, this method classifies crops based on a simple "one-size-fits-all" probability threshold setting method, 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 object, in a first aspect, the present invention discloses a method for extracting stable pixels of crop rotation, comprising:

[0007] Acquire image data corresponding to the target area and first historical crop planting type data;

[0008] Determine a 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 second historical crop type data corresponding to each pixel;

[0009] Determine, according to 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;

[0010] Inputting the second historical crop type data into a plurality of pre-trained classifiers for classification respectively, obtaining 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 type output by each of the classifiers is 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. First, image data and first historical crop planting type data corresponding to a target area are collected to assign corresponding second historical crop planting type data to the position corresponding to each pixel in the image data. Finally, the pixel is judged whether it is a stable crop rotation pixel according to the second historical crop planting type data corresponding to each 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 according to 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 error caused by one-size-fits-all threshold setting and improve the accuracy of classification.

[0014] After calculating the planting sequence and crop rotation stability rate corresponding to each pixel, the second historical crop type data corresponding to the pixel is input into a plurality of pre-trained classifiers for classification, so as to combine the output results of the plurality of classifiers to finally determine the pixel, thereby improving the accuracy of pixel extraction. After each classifier outputs the classification result of the pixel, a threshold of the classification probability is set in combination with the classification result and the crop rotation stability rate, so as to perform accuracy verification on the output result of the classifier according to the probability threshold that takes into account various aspects, thereby improving the accuracy of pixel extraction.

[0015] As a preferred example, the step of acquiring image data corresponding to the target area and first historical crop planting type data includes:

[0016] Obtaining a historical annual crop list of the 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 planted crop types, the 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 later and improve the efficiency of pixel extraction.

[0019] As a preferred example, determining 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 includes:

[0020] According to the second historical crop type data, the crop type planted in each pixel in each year is obtained to sort the crop types according to the time sequence, and a first planting sequence and a second planting sequence corresponding to each pixel are generated; wherein the second planting sequence includes the first planting sequence;

[0021] Acquire 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] The ratio of the first quantity to the second quantity is calculated, and the ratio is used as the 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, and then sets the corresponding probability threshold in combination with 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 according to 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 respectively;

[0026] 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;

[0027] 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;

[0028] The crop rotation law corresponding to the second historical crop type data is learned through 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 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 classification of the pixels.

[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 the second planting sequence corresponding to each pixel and the crop rotation stability rate corresponding to the first planting sequence;

[0032] Determining a crop rotation pattern corresponding to each pixel according to the second planting sequence; wherein the crop rotation pattern is constructed according to corn, soybean, winter wheat and forage grass;

[0033] The probability threshold is constructed by combining 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 types output by each classifier is greater than the probability threshold, the pixel currently input to the classifier is identified as 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, including 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 number 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 stable pixel extraction system, which first collects image data and first historical crop planting type data corresponding to a target area, so as to assign corresponding second historical crop planting type data to the position corresponding to each pixel in the image data, and finally judges whether the pixel belongs to a crop rotation stable pixel according to the second historical crop planting type data corresponding to each pixel, that is, judges 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 according to the second historical crop type data, and then the probability threshold is set in combination with the crop rotation stability rate of each pixel to avoid the technical problem of large classification error caused by the one-size-fits-all threshold setting, thereby improving the accuracy of classification.

[0048] After calculating the planting sequence and crop rotation stability rate corresponding to each pixel, the second historical crop type data corresponding to the pixel is input into a plurality of pre-trained classifiers for classification, so as to combine the output results of the plurality of classifiers to finally determine the pixel, thereby improving the accuracy of pixel extraction. After each classifier outputs the classification result of the pixel, a threshold of the classification probability is set in combination with the classification result and the crop rotation stability rate, so as to perform accuracy verification on the output result of the classifier according to the probability threshold that takes into account various aspects, 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 according to the main planted crop type; wherein the first historical crop planting type data includes corn, soybeans, winter wheat, forage grass 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 later 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 rotation stable pixel extraction method 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 a 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 : It is a structural schematic 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 be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only 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.

[0059] Embodiment 1

[0060] This embodiment discloses a method for extracting stable pixels of crop rotation. For details, please refer to Figure 1 , mainly including steps 101 to 106, the steps mainly include:

[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 to count the main planted crop types corresponding to the target area according to 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 grass 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 from 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 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.

[0066] In this embodiment, this step mainly includes: according to the second historical crop type data, obtaining the crop type planted for each pixel in each year, so as to sort the crop types according to the 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 having the first planting sequence and a second number corresponding to the pixels having the second planting sequence; calculating the ratio of the first number to the second number, so as to use 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 according to the ratio of the second planting sequence to the first planting sequence, and then sets the corresponding probability threshold in combination with 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 according to 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 outputted by each classifier for each pixel and the classification probability corresponding to the crop type.

[0069] In this embodiment, the 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 classification of the pixels.

[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, the 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 according to 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 a high-precision probability threshold.

[0074] Step 106: When the crop type output by each of the classifiers is 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.

[0075] In this embodiment, the 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 the crop types are determined to be 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 into 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 collection 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 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.

[0081] The crop prediction module 204 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.

[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 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 types output by each of the classifiers are consistent and each of the classification probabilities 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 according to the main planted crop type; wherein the first historical crop planting type data includes corn, soybeans, winter wheat, forage grass 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] Embodiment 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 according to the annual crop list.

[0091] In this embodiment, the 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 obtain the image data corresponding to the target area and the ACI data and annual crop list data corresponding to each of the previous years, and then obtain the ACI data corresponding to the nearest year to determine the main crop type planted in the target area according to the ACI data. In an application example, the ACI data of the target area from 2011 to 2021 is obtained, and then the proportion of different types of landforms 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 in each year of the pixel 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 according to 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 in each pixel in each year according to the second historical crop type data, sorting the crop types according to chronological order, generating a first planting sequence and a second planting sequence corresponding to each pixel, calculating the ratio of the first quantity corresponding to the first planting sequence to the second quantity corresponding to the second planting sequence, and using 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 according to the crops planted in each year. For example, in the ACI data from 2011 to 2021, a certain pixel is planted with soybeans, corn, soybeans, corn, soybeans, corn, and soybeans in sequence from 2012 to 2018, and the first planting sequence corresponding to the pixel is soybeans-corn-soybean-corn-soybean-corn-soybean, and then the crop type planted by the pixel in 2019 is obtained. When the crop type is corn, the second planting sequence corresponding to the pixel is soybeans-corn-soybean-corn-soybean-corn-soybean-corn.

[0097] Next, the first number of samples having the first planting sequence among the pixels corresponding to the target area is calculated, and the pixels that still plant corn in the next year of the first planting sequence to form the second planting sequence are pixels that meet the requirements of crop rotation stability. At this time, the second number of pixels having the second planting sequence is calculated, and the crop rotation stability rate corresponding to the first planting sequence or the second planting sequence is calculated according to the first number and the second number by a preset crop rotation stability rate calculation formula; wherein the crop rotation stability rate calculation formula is: The 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 the application example, if there are 362 pixels with the first planting sequence, and there are 330 pixels that still plant corn in the next year, then the rotation stability rate of this planting sequence is 91.16%. The higher the stability rate, the higher the probability that the crop planting sequence is planted according to this rotation pattern in the study area, and the more stable this rotation pattern is. The rotation stability rate can reflect the stability of a specific planting sequence in a certain area. The value range of this indicator is 0-1. The closer the value is to 1, the higher the stability of the planting sequence in the sample data set. It is easier to extract rotation stability pixels with higher reliability in actual crop pre-season prediction.

[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 result 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 corresponding crop types and classification probabilities through different classifiers.

[0101] Specifically, we first select three classifiers, namely, multi-layer perceptron, random forest and extreme gradient boosting, to form an integrated learning model for pixel classification. Then, we train the model and use grid optimization to select the best parameter combination corresponding to each classifier during the training process. For details, please refer to Table 1 for the best parameter combination:

[0102]

[0103]

[0104] Furthermore, the training process of the ensemble learning model is:

[0105] 1) Data collection and preprocessing: Obtain the ACI data of the previous years (set to collect data from 2011 to 2020) in the study area, and reclassify them. The pixel numbered 147 in the ACI data is classified as corn and renumbered as 1; the pixel numbered 158 is soybean and renumbered as 2; the pixels numbered 132, 140 and 145 are classified as winter wheat and renumbered as 3; the pixel numbered 122 is forage grass and renumbered as 4; all other crops and non-agricultural areas are classified as other crops and renumbered as 5.

[0106] 2) Construct training data sets and test sets; among them, all pixels in the study area are selected as test samples, and the features of each sample are composed of crop types from 2014 to 2020; 0.25% of the pixels in the study area are selected as training samples using a random sampling strategy. Specifically, pixels of corn, soybeans, winter wheat, pastures and other features in the ACI data of 2019 and 2020 are selected as training data labels for the integrated model, and their features are composed of crop type data from the past 7 years. For example, if the label of a training sample is corn in 2019, and its features are the crop types of the pixel from 2012 to 2018, which are soybeans, corn, soybeans, corn, soybeans, corn, and soybeans, respectively, then this training sample is represented as 2-1-2-1-2-1-2-1, the last 1 is the training set label, and the first seven numbers are the training set features. Two years of ACI data were selected as training sample labels because the crop planting sequence collected from a single year may not fully cover the rotation of different crops. Crop planting sequences from different years can help the model better adapt to the planting patterns of farmland in different years and improve the generalization ability of the model on unknown samples.

[0107] 3) Setting the probability threshold of the model; firstly, based on the same calculation method, the rotation stability rate corresponding to each rotation mode, i.e., planting sequence in the training sample is statistically analyzed, and then the rotation modes are sorted to determine the more stable rotation mode in the study area; secondly, the probability threshold is determined based on the output results of each classifier in the model and the rotation stability rate.

[0108] In the process of setting the above probability threshold, the output of each classifier includes a crop type map (i.e., the possible crop types to be planted) and a probability map (the distribution probability corresponding to each crop type). The type map is similar to the ACI data, and each pixel in the probability map is the predicted probability of each test sample based on the output of predict_proba(). Specifically, it returns an array in which each row represents a test sample, each column represents the probability that the sample belongs to a certain category, and the category with the largest probability value in each row is the predicted classification result of the test sample. For example, if the classification result of one pixel is corn, that is, the result output by the model is "1", and the classification probability is 88%, it means that the model believes that the certainty of this pixel is corn is 88%. Secondly, query the crop type of this pixel in the ACI data from 2014 to 2020 to generate a crop planting sequence. Then calculate the rotation stability rate that meets the crop planting sequence in the training sample. 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 a stable rotation pattern was comprehensively selected.

[0109] Then, the accuracy of the trained model was verified. In the accuracy verification process, the classification accuracy of the single model was compared with that of the ensemble learning model, as shown in Table 2. 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 is superior to the single model in all accuracy indicators on all crops, showing its significant advantages in improving classification accuracy and stability. Specifically, Table 2 is:

[0110]

[0111] Table 2 summarizes the accuracy performance of MLP, XGBoost, RF and ensemble learning models on different crops, including three indicators: F1-score, Kappa coefficient and overall accuracy (OA). The results show that the accuracy indicators of the ensemble learning model on all crops are better than those of a single model, showing its significant advantages in improving classification accuracy and stability.

[0112] Secondly, in order to explore the cross-temporal applicability of the model, crop rotation stability pixel maps for 2020 and 2021 were drawn, and the accuracy was verified using ground truth data from 2020 and 2021. As shown in Table 3, the results show that the overall accuracy of the model classification results for both 2020 and 2021 is very high, both reaching more than 90%. Among them, the classification effects of soybeans and winter wheat are relatively ideal, with F1-scores of 0.94 and 0.91, respectively. However, the F1-scores of corn and forage are relatively low, at 0.90 and 0.89, respectively.

[0113]

[0114]

[0115] Step 304: According to the classification result and the crop rotation stability rate, the corresponding probability threshold is calculated by the probability threshold calculation method preset in the integrated learning model, and the crop rotation stability pixels in the image data are extracted according to the probability threshold and the classification result.

[0116] In this embodiment, the 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 according to 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, by setting the model during the training process of the model, the probability threshold corresponding to the current pixel can be calculated 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, wherein 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, setting the optimal probability threshold, and combining three classifiers, a multi-layer perceptron, a random forest, and extreme gradient boosting, an integrated learning model is constructed. The model selects stable crop rotation pixels according to the unanimous voting method, effectively filters out unstable classification results, and improves the stability and accuracy of the overall classification.

[0120] Furthermore, the method proposed in this embodiment uses an integrated learning model composed of multiple classifiers (MLP, random forest, XGBoost) and combines it with the consensus voting method to screen stable pixels in crop rotation. Through multi-model fusion, the robustness of the classification results is improved, the deviation and error that may be caused by a single model is reduced, thereby improving the overall classification performance.

[0121] Furthermore, when calculating the probability threshold, the classification probability distribution map is constructed by calculating the rotation stability rate (RSR) and combining the classification probability output by the classifier, so as to determine the optimal classification probability threshold and ensure that the selected rotation stability pixels have high reliability.

[0122] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. It is particularly pointed out that for those skilled in the art, any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention should be included in the scope of protection of the present invention.

Claims

1. A method for extracting stable pixels of crop rotation, characterized in that: include: Acquire image data corresponding to the target area and first historical crop planting type data; Determine a 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 second historical crop type data corresponding to each pixel; Determine, according to 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; Inputting the second historical crop type data into a plurality of pre-trained classifiers for classification respectively, obtaining 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 type output by each of the classifiers is 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 crop rotation stable pixel extraction method according to claim 1, characterized in that: The step of acquiring image data corresponding to the target area and first historical crop planting type data includes: Obtaining a historical annual crop list of the 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 planted crop types, the 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. A crop rotation stable pixel extraction method according to claim 2, characterized in that: Determining 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 includes: According to the second historical crop type data, the crop type planted in each pixel in each year is obtained to sort the crop types according to the time sequence, and a first planting sequence and a second planting sequence corresponding to each pixel are generated; wherein the second planting sequence includes the first planting sequence; Acquire 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; The ratio of the first quantity to the second quantity is calculated, and the ratio is used as the crop rotation stability rate corresponding to the first planting sequence.

4. The crop rotation stable pixel extraction method according to claim 1, characterized in that: 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 respectively; 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; The crop rotation law corresponding to the second historical crop type data is learned through 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.

5. The crop rotation stable pixel extraction method according to claim 3, characterized in that: The setting of the probability threshold according to the planting sequence, the classification probability and the crop rotation stability rate includes: Obtaining the second planting sequence corresponding to each pixel and the crop rotation stability rate corresponding to the first planting sequence; Determining a crop rotation pattern corresponding to each pixel according to the second planting sequence; wherein the crop rotation pattern is constructed according to corn, soybean, winter wheat and forage grass; The probability threshold is constructed by combining the crop rotation pattern, the classification probability corresponding to the crop type and the crop rotation stability rate.

6. The crop rotation stable pixel extraction method according to claim 4, 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.

7. 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 according to the second historical crop type data; 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.

8. The crop rotation stable pixel extraction system according to claim 7, 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 according to the main planted crop type; wherein the first historical crop planting type data includes corn, soybeans, winter wheat, forage grass and others.

9. An electronic device, characterized in that: include: 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 crop rotation stable pixel extraction method as described in any one of claims 1 to 6 is implemented.

10. 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 as described in any one of claims 1 to 6.

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

  • Crop rotation based computer-implemented method for estimating a consumption of an agricultural product for a geographical region

    WO2024037889A1