A method, device and medium for fine classification of crops
Through random forest machine learning and decision tree model, combined with sample migration ideas, a crop fine classifier is generated, which solves the problem of accuracy limitation caused by regional and time differences in crop classification, and achieves high-precision and convenient classification effects.
Patent Information
- Application Number
- CN202510598929.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-09
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-05-09
AI Technical Summary
In the classification of crops, the classification accuracy is limited due to regional and time differences in the prior art, and there are problems of missed judgments or misjudgments.
Random forest machine learning algorithm and decision tree model are used, combined with sample migration ideas, important elements are extracted from high-resolution satellite data, multiple preselected classifiers are generated, and the final classifier is generated through rules to perform fine classification of crops.
It improves the accuracy and convenience of crop classification, can be promoted in large-scale application scenarios, and achieves fast and efficient fine classification.
Smart Images

Figure CN120126010B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of crop classification, and more particularly, to a method, device and medium for fine classification of crops. Background Art
[0002] Remote sensing technology, with its advantages of macroscopicity, timeliness and accuracy, has become an important means of extracting agricultural information. Studies have shown that satellite spectral information can be used to separate different crops. Currently, the classification of crops, especially major food crops such as rice, wheat, and corn, and major oil crops such as peanuts and soybeans, usually adopts traditional machine learning classification methods. Due to the influence of regional and temporal differences, not only is the classification accuracy of different crops limited, but the same crop may also be missed or misjudged due to the solidification of samples. Summary of the Invention
[0003] In view of the deficiencies of the prior art, the present invention provides a method, device and medium for fine classification of crops.
[0004] According to one aspect of the present invention, a method for fine classification of crops is provided, comprising:
[0005] A sample dataset is randomly and evenly extracted from the historical dataset and the current dataset of crops, wherein the sample dataset includes: a source domain sample dataset and a target domain sample dataset, and the historical dataset and the current dataset are high-resolution satellite data;
[0006] Using the random forest machine learning algorithm, the pre-selected elements are ranked by importance based on the source domain sample dataset and the target domain sample dataset to obtain the important element set;
[0007] The sample data set is randomly sampled and grouped to generate M groups of sample data subsets. The decision tree model is then used to learn the M groups of sample data subsets and the target domain sample data set according to the important feature set to generate M+1 pre-selected classifiers.
[0008] Generate the final classifier based on M+1 pre-selected classifiers using pre-set rules and important feature sets;
[0009] The data to be classified is classified according to the final classifier to obtain the classification result of the current data set, where the data to be classified is the current data set excluding the target domain sample data set.
[0010] Optionally, sample datasets are randomly and uniformly drawn from the historical datasets and current datasets of crops, including:
[0011] Randomly and evenly extract historical sample data from the historical data set as the source domain sample data set;
[0012] Randomly and uniformly extract the current data sample dataset from the current dataset as the target domain sample dataset;
[0013] A sample dataset is determined based on a source domain sample dataset and a target domain sample dataset.
[0014] Optionally, the pre-selected elements include: band data and vegetation and water index, where
[0015] Band data includes: red light band R, green light band G, blue light band B and near infrared band NIR;
[0016] Vegetation and water indices include: Normalized Difference Vegetation Index (NDVI), Enhanced Vegetation Index (EVI), Soil Adjusted Vegetation Index (SAVI), Greenness Index (GI), Difference Vegetation Index (DVI), Green Vegetation Index (GVI), Green Normalized Difference Vegetation Index (GNDVI) and Normalized Difference Water Index (NDWI).
[0017] Optionally, M+1 pre-selected classifiers Includes: Pre-selected classifiers corresponding to M groups of sample data subsets And the pre-selected classifier corresponding to the target domain sample dataset ,and
[0018] Using pre-set rules and important feature sets, the final classifier is generated based on M+1 pre-selected classifiers, including:
[0019] Step 1: Calculate the classification accuracy of each of the M+1 pre-selected classifiers D for the target domain sample data set and sort them in descending order to obtain the sorted classification accuracy ;
[0020] Step 2: Initialize parameters, including: accuracy threshold ; First intermediate classifier ; Second intermediate classifier: ;m=1,m≤M;
[0021] Step 3: Iterate based on the initialization parameters and output the second intermediate classifier ;
[0022] Step 4: Let the final classifier , the new prediction accuracy ,reduce The last element in the new , return to step 1, if Greater than , update the final classifier and the new prediction accuracy ,until The number of important features in is less than 5, and the iteration ends, and the final classifier is output. .
[0023] Optionally, step 3: loop iteration based on the initialization parameters and output the second intermediate classifier include:
[0024] Step 1): Update parameter m=m+1;
[0025] Step 2): Update the first intermediate classifier ;
[0026] Step 3): Using the first intermediate classifier Each pre-selected classifier predicts the target domain sample dataset S t , obtain multiple prediction classification results;
[0027] Step 4): Use voting to determine the classification result based on multiple predicted classification results and calculate the voting prediction accuracy;
[0028] Step 5): If the voting prediction accuracy , then update , ;
[0029] Step 6): Return to step 1) for iterative calculation. When m>M, end the loop and obtain the second intermediate classifier. .
[0030] According to another aspect of the present invention, there is provided a device for finely classifying crops, comprising:
[0031] An extraction module is used to randomly and evenly extract a sample data set from a historical data set and a current data set of crops, wherein the sample data set includes: a source domain sample data set and a target domain sample data set, and the historical data set and the current data set are high-resolution satellite data;
[0032] An acquisition module is used to use a random forest machine learning algorithm to sort the importance of pre-selected elements based on a source domain sample dataset and a target domain sample dataset to obtain an important element set;
[0033] The first generation module is used to randomly sample and group the sample data set to generate M groups of sample data subsets, and use the decision tree model to learn the M groups of sample data subsets and the target domain sample data set according to the important feature set to generate M+1 pre-selected classifiers;
[0034] The second generation module is used to generate a final classifier based on the M+1 pre-selected classifiers using pre-set rules and important feature sets;
[0035] The classification module is used to classify the data to be classified according to the final classifier and obtain the classification results of the current data set, where the data to be classified is the current data set excluding the target domain sample data set.
[0036] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores a computer program, and the computer program is used to execute the method according to any one of the above aspects of the present invention.
[0037] According to another aspect of the present invention, an electronic device is provided, comprising: a processor; a memory for storing instructions executable by the processor; and the processor for reading the executable instructions from the memory and executing the instructions to implement the method described in any one of the above aspects of the present invention.
[0038] Therefore, the present invention combines the decision tree model and the idea of sample migration to construct a method for fine-grained crop classification. First, historical data samples and current data samples are extracted; band data, vegetation, and water index elements are selected, and all samples are used to rank the elements by importance, selecting a set of important elements that accounts for more than 5%; all samples of more than 5% important elements are randomly sampled and grouped, and a decision tree is used to learn multiple pre-selected classifiers; for the multiple pre-selected classifiers that have been generated, the current data samples are used to produce a final classifier according to the rules; and the current data is classified according to the final classifier. Compared with the existing technology, the present invention can not only improve the accuracy and convenience of the classification results, but also be promoted in large-scale application scenarios. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] A more complete understanding of exemplary embodiments of the present invention may be obtained by referring to the following drawings:
[0040] Figure 1 1 is a flow chart of a method for fine classification of crops provided by an exemplary embodiment of the present invention;
[0041] Figure 2 1 is a schematic structural diagram of a device for finely classifying crops provided by an exemplary embodiment of the present invention;
[0042] Figure 3 This is a structure of an electronic device provided by an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0043] Below, the exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention, and it should be understood that the present invention is not limited to the exemplary embodiments described herein.
[0044] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
[0045] Those skilled in the art will understand that the terms "first" and "second" in the embodiments of the present invention are only used to distinguish different steps, devices or modules, and neither represent any specific technical meaning nor indicate the necessary logical order between them.
[0046] It should also be understood that, in the embodiments of the present invention, “a plurality of” may refer to two or more than two, and “at least one” may refer to one, two or more than two.
[0047] It should also be understood that any component, data or structure mentioned in the embodiments of the present invention can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0048] In addition, the term "and / or" in this invention merely describes an association relationship between related objects, indicating that three possible relationships exist. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Furthermore, the character " / " in this invention generally indicates that the related objects are in an "or" relationship.
[0049] It should also be understood that the description of the various embodiments of the present invention focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced with each other. For the sake of brevity, they will not be described one by one.
[0050] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0051] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
[0052] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered part of the specification.
[0053] It should be noted that like reference numerals and letters refer to like items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0054] Embodiments of the present invention may be applied to electronic devices such as terminal devices, computer systems, and servers, and may operate in conjunction with numerous other general-purpose or specialized computing system environments or configurations. Examples of well-known terminal devices, computing systems, environments, and / or configurations suitable for use with terminal devices, computer systems, servers, and other electronic devices include, but are not limited to, personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network personal computers, minicomputer systems, mainframe computer systems, and distributed cloud computing technology environments including any of the above.
[0055] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system-executable instructions (such as program modules) executed by a computer system. Generally, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in a distributed cloud computing environment, where tasks are performed by remote processing devices linked via a communication network. In a distributed cloud computing environment, program modules can be located on local or remote computing system storage media, including storage devices.
[0056] Exemplary Methods
[0057] Figure 1 This is a flow chart of a method for fine classification of crops provided by an exemplary embodiment of the present invention. This embodiment can be applied to electronic devices, such as Figure 1 As shown, the method 100 for fine classification of crops includes the following steps:
[0058] Step 101: randomly and evenly extract a sample dataset from a historical dataset and a current dataset of crops, wherein the sample dataset includes: a source domain sample dataset and a target domain sample dataset, and the historical dataset and the current dataset are high-resolution satellite data;
[0059] Step 102: using a random forest machine learning algorithm, ranking the pre-selected elements by importance based on the source domain sample dataset and the target domain sample dataset to obtain an important element set;
[0060] Step 103: Randomly sample and group the sample data set to generate M groups of sample data subsets, and use the decision tree model to learn the M groups of sample data subsets and the target domain sample data set according to the important feature set to generate M+1 pre-selected classifiers;
[0061] Step 104, using pre-set rules, generating a final classifier based on the M+1 pre-selected classifiers;
[0062] Step 105 , classify the data to be classified according to the final classifier to obtain the classification result of the current data set, wherein the data to be classified is the current data set excluding the target domain sample data set.
[0063] Specifically, in order to be able to classify crops quickly, efficiently and accurately without being limited to the crop categories in the original sample data set, the present invention proposes a decision tree model of optimal features and the idea of sample migration to construct a set of crop fine classification methods.
[0064] To achieve the above objectives, the present invention's fine-grained crop classification method requires the use of medium- and high-resolution data (Landsat data). The specific steps are: 1) First, extract historical data samples and current data samples; 2) Select band data, vegetation, and water index elements, use all samples to rank the elements by importance, and select elements that account for more than 5%; 3) Randomly sample all samples of elements above 5% and group them, using a decision tree to learn multiple pre-selected classifiers; 4) Based on the generated multiple pre-selected classifiers, use the current data samples to generate a final classifier according to the rules; 5) Classify the current data based on the final classifier. The specific implementation is as follows:
[0065] 1) Using field survey data, historical satellite data and high-resolution Google Earth images, we randomly and evenly extract historical data sample datasets, namely the source domain sample datasets: ; Use current satellite data combined with high-resolution Google Earth images to randomly and evenly extract the current data sample dataset, that is, the target domain sample dataset: ; Composition of sample data set ;
[0066] 2) Select preset elements, including: band data, vegetation and water index elements , using the random forest machine learning algorithm, using all samples Sort the elements by importance and select the elements with more than 5% as the important element set ;
[0067] Among them, the band data (4) include red light band (R), green light band (G); blue light band (B), near infrared wave (NIR); vegetation and water body indices (8) include: Normalized Difference Vegetation Index (NDVI), Enhanced Vegetation Index (EVI), Soil Adjusted Vegetation Index (SAVI), Greenness Index (GI), Difference Vegetation Index (DVI), Green Vegetation Index (GVI), Green Normalized Vegetation Index (GNDVI), Normalized Difference Water Index (NDWI); Definition formula:
[0068] Normalized Difference Vegetation Index (NDVI): ;
[0069] Enhanced Vegetation Index (EVI): ;
[0070] Soil Adjusted Vegetation Index (SAVI): ;
[0071] Greenness Index (GI): ;
[0072] Difference Vegetation Index (DVI): ;
[0073] Green Vegetation Index (GVI): ;
[0074] Green Normalized Difference Vegetation Index (GNDVI): ;
[0075] Normalized Difference Water Index (NDWI): .
[0076] 3) For important feature sets All samples Random sampling grouping , use the decision tree model (DTM) to learn X separately and generate M pre-selected classifiers ; Use decision tree model to analyze target domain sample data set Learn and generate a classifier ;renew ;
[0077] 4) Based on the generated M+1 pre-selected classifiers , using rules to generate the final classifier and prediction accuracy , the rules are as follows:
[0078] (1) Using step 3) Calculate the target domain sample data set for each pre-selected classifier in D The classification accuracy is sorted in descending order. ;
[0079] (2) Initialization accuracy threshold: ; Intermediate classifier 1: ; Intermediate classifier 2: ; m=1, m≤M;
[0080] (3) Cycle the following process :
[0081] a, m=m+1, m≤M;
[0082] b. Update ;
[0083] c. Utilization Each classifier predicts the target domain sample dataset S t
[0084] d. Use voting to determine the classification results based on multiple predicted classification results and calculate the voting prediction accuracy ;
[0085] e. If the voting prediction accuracy , then update , ;
[0086] f. Return to a.
[0087] (4) After the cycle ends, the intermediate classifier 2 is obtained ;
[0088] (5) , ,reduce The last element in the new , repeat (1)-(4), if Greater than ,renew and ,until If the number of elements is less than 5, all iterations will be terminated.
[0089] 5) According to 4) final classifier , classify the data outside the current sample data.
[0090] Therefore, the present invention combines decision tree models with sample migration concepts to construct a refined crop classification method. This method first extracts historical and current data samples. Band data, vegetation, and water index elements are selected, and all samples are used to rank the elements by importance, selecting elements that represent more than 5%. All samples of elements above 5% are randomly sampled and grouped, and a decision tree is used to learn multiple pre-selected classifiers. Based on the generated pre-selected classifiers, the current data sample is used to generate a final classifier according to the rules. The current data is then classified based on the final classifier. Compared to existing technologies, this method not only improves the accuracy and convenience of classification results but also can be applied to large-scale scenarios.
[0091] Therefore, the present invention combines decision tree models with sample migration concepts to construct a refined crop classification method. This method first extracts historical and current data samples. Band data, vegetation, and water index elements are selected, and all samples are used to rank the elements by importance, selecting elements that represent more than 5%. All samples of elements above 5% are randomly sampled and grouped, and a decision tree is used to learn multiple pre-selected classifiers. Based on the generated pre-selected classifiers, the current data sample is used to generate a final classifier according to the rules. The current data is then classified based on the final classifier. Compared to existing technologies, this method not only improves the accuracy and convenience of classification results but also can be applied to large-scale scenarios.
[0092] Exemplary devices
[0093] Figure 2 FIG. 1 is a schematic diagram of a fine classification device for crops provided by an exemplary embodiment of the present invention. Figure 2 As shown, the apparatus 200 includes:
[0094] An extraction module 210 is configured to randomly and uniformly extract a sample dataset from a historical dataset and a current dataset of crops, wherein the sample dataset includes a source domain sample dataset and a target domain sample dataset, and the historical dataset and the current dataset are high-resolution satellite data;
[0095] An acquisition module 220 is configured to use a random forest machine learning algorithm to sort the importance of pre-selected elements based on the source domain sample dataset and the target domain sample dataset to obtain an important element set;
[0096] The first generation module 230 is used to randomly sample and group the sample data set to generate M groups of sample data subsets, and use the decision tree model to learn the M groups of sample data subsets and the target domain sample data set according to the important factor set to generate M+1 pre-selected classifiers;
[0097] The second generation module 240 is used to generate a final classifier based on the M+1 pre-selected classifiers using pre-set rules and important element sets;
[0098] The classification module 250 is used to classify the data to be classified according to the final classifier to obtain the classification result of the current data set, wherein the data to be classified is the current data set excluding the target domain sample data set.
[0099] Optionally, the extraction module 210 includes:
[0100] The first extraction submodule is used to randomly and evenly extract historical sample data from the historical data set as the source domain sample data set;
[0101] The second extraction submodule is used to randomly and uniformly extract the current data sample data set from the current data set as the target domain sample data set;
[0102] The determination submodule is used to determine a sample dataset based on a source domain sample dataset and a target domain sample dataset.
[0103] Optionally, the pre-selected elements include: band data and vegetation and water index, where
[0104] Band data includes: red light band R, green light band G, blue light band B and near infrared band NIR;
[0105] Vegetation and water indices include: Normalized Difference Vegetation Index (NDVI), Enhanced Vegetation Index (EVI), Soil Adjusted Vegetation Index (SAVI), Greenness Index (GI), Difference Vegetation Index (DVI), Green Vegetation Index (GVI), Green Normalized Difference Vegetation Index (GNDVI) and Normalized Difference Water Index (NDWI).
[0106] Optionally, M+1 pre-selected classifiers Includes: Pre-selected classifiers corresponding to M groups of sample data subsets And the pre-selected classifier corresponding to the target domain sample dataset ,and
[0107] The second generation module 240 includes:
[0108] Step 1: Calculate the classification accuracy of each of the M+1 pre-selected classifiers D for the target domain sample data set and sort them in descending order to obtain the sorted classification accuracy ;
[0109] Step 2: Initialize parameters, including: accuracy threshold ; First intermediate classifier ; Second intermediate classifier: ;m=1,m≤M;
[0110] Step 3: Iterate based on the initialization parameters and output the second intermediate classifier ;
[0111] Step 4: Let the final classifier , the new prediction accuracy ,reduce The last element in the new , return to step 1, if Greater than , update the final classifier and the new prediction accuracy ,until The number of important features in is less than 5, and the iteration ends, and the final classifier is output. .
[0112] Optionally, step 3: loop iteration based on the initialization parameters and output the second intermediate classifier include:
[0113] Step 1): Update parameter m=m+1;
[0114] Step 2): Update the first intermediate classifier ;
[0115] Step 3): Using the first intermediate classifier Each pre-selected classifier predicts the target domain sample dataset S t , obtain multiple prediction classification results;
[0116] Step 4): Use voting to determine the classification result based on multiple predicted classification results and calculate the voting prediction accuracy;
[0117] Step 5): If the voting prediction accuracy , then update , ;
[0118] Step 6): Return to step 1) for iterative calculation. When m>M, end the loop and obtain the second intermediate classifier. .
[0119] Exemplary electronic devices
[0120] Figure 3 This is the structure of an electronic device provided by an exemplary embodiment of the present invention. Figure 3 As shown, the electronic device 30 includes one or more processors 31 and a memory 32 .
[0121] The processor 31 may be a central processing unit (CPU) or other forms of processing units having data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0122] The memory 32 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), a hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 31 may execute the program instructions to implement the software program methods and / or other desired functions of the various embodiments of the present invention described above. In one example, the electronic device may further include an input device 33 and an output device 34, which are interconnected via a bus system and / or other form of connection mechanism (not shown).
[0123] In addition, the input device 33 may also include, for example, a keyboard, a mouse, and the like.
[0124] The output device 34 can output various information to the outside. The output device 34 can include, for example, a display, a speaker, a printer, a communication network and a remote output device connected thereto.
[0125] Of course, to simplify, Figure 3 Only some of the components related to the present invention in the electronic device are shown, and components such as a bus, an input / output interface, etc. are omitted. In addition, the electronic device may further include any other appropriate components according to specific application conditions.
[0126] Exemplary computer program products and computer-readable storage media
[0127] In addition to the above-mentioned methods and devices, an embodiment of the present invention may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to perform the steps of the method according to various embodiments of the present invention described in the above "Exemplary Method" section of this specification.
[0128] The computer program product may be written in any combination of one or more programming languages to implement the operations of embodiments of the present invention, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as C or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's computing device, as a stand-alone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0129] In addition, an embodiment of the present invention may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, enable the processor to execute the steps of the method according to various embodiments of the present invention described in the above "Exemplary Method" section of this specification.
[0130] The computer-readable storage medium may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may include, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0131] The basic principles of the present invention have been described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, and effects mentioned in the present invention are merely illustrative and non-limiting, and should not be construed as necessarily possessed by each embodiment of the present invention. Furthermore, the specific details disclosed above are provided for illustrative purposes and to facilitate understanding, and are not intended to be limiting. These details do not necessarily limit the present invention to being implemented using these specific details.
[0132] Each embodiment in this specification is described in a progressive manner, with each embodiment focusing on its differences from the other embodiments. References to the same or similar parts between the various embodiments are sufficient. For system embodiments, since they largely correspond to method embodiments, their description is relatively simple. For relevant parts, references to the description of the method embodiments are sufficient.
[0133] The block diagrams of the devices, systems, equipment, and systems involved in the present invention are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, systems, equipment, and systems can be connected, arranged, or configured in any manner. Words such as "including," "comprising," "having," and the like are open-ended words, meaning "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or" and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0134] The method and system of the present invention may be implemented in many ways. For example, the method and system of the present invention may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above sequence of steps for the method is for illustration only, and the steps of the method of the present invention are not limited to the sequence specifically described above, unless otherwise specified. In addition, in some embodiments, the present invention may also be implemented as a program recorded in a recording medium, which includes machine-readable instructions for implementing the method according to the present invention. Thus, the present invention also covers recording media that store programs for executing the method according to the present invention.
[0135] It should also be noted that, in the system, device and method of the present invention, each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. The above description of the disclosed aspects is provided to enable any technician in this field to make or use the present invention. Various modifications to these aspects will be very obvious to those skilled in the art, and the general principles defined here can be applied to other aspects without departing from the scope of the present invention. Therefore, the present invention is not intended to be limited to the aspects shown here, but according to the widest scope consistent with the principles disclosed here and novel features.
[0136] The above description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the present invention to the forms disclosed herein. Although a number of example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations thereof.
Claims
1. A method for fine classification of crops, characterized in that: include: A sample data set is randomly and evenly extracted from a historical data set and a current data set of crops, wherein the sample data set includes: a source domain sample data set and a target domain sample data set, and the historical data set and the current data set are high-resolution satellite data; Using a random forest machine learning algorithm, the pre-selected elements are ranked by importance according to the source domain sample dataset and the target domain sample dataset to obtain an important element set; Randomly sampling and grouping the sample data set to generate M groups of sample data subsets, and using a decision tree model to learn the M groups of sample data subsets and the target domain sample data set according to the important element set to generate M+1 pre-selected classifiers; Generate a final classifier based on the M+1 pre-selected classifiers using the pre-set rules and the important element set; The data to be classified is classified according to the final classifier to obtain the classification result of the current data set, wherein the data to be classified is the current data set excluding the target domain sample data set; wherein, M+1 pre-selected classifiers Includes: Pre-selected classifiers corresponding to M groups of sample data subsets And the pre-selected classifier corresponding to the target domain sample dataset ,and Using the pre-set rules and the important element set, a final classifier is generated based on the M+1 pre-selected classifiers, including: Step 1: Calculate the classification accuracy of each of the M+1 pre-selected classifiers D for the target domain sample data set and sort them in descending order to obtain the sorted classification accuracy ; Step 2: Initialize parameters, including: accuracy threshold ; First intermediate classifier ; Second intermediate classifier: ;m=1,m≤M; Step 3: Iterate based on the initialization parameters and output the second intermediate classifier ; Step 4: Let the final classifier , the new prediction accuracy ,reduce The last element in the new , return to step 1, if Greater than , update the final classifier and the new prediction accuracy ,until The number of important features in is less than 5, and the iteration ends, and the final classifier is output. ; Step 3: Iterate based on the initialization parameters and output the second intermediate classifier ,include: Step 1): Update parameter m=m+1; Step 2): Update the first intermediate classifier ; Step 3): Using the first intermediate classifier Each pre-selected classifier predicts the target domain sample dataset S t , obtain multiple prediction classification results; Step 4): Use voting to determine the classification result based on multiple predicted classification results and calculate the voting prediction accuracy; Step 5): If the voting prediction accuracy , then update , ; Step 6): Return to step 1) for iterative calculation. When m>M, end the loop and obtain the second intermediate classifier. .
2. The method according to claim 1, characterized in that The sample datasets are randomly and evenly extracted from the historical datasets and current datasets of crops, including: Randomly and evenly extracting historical sample data from the historical data set as a source domain sample data set; Randomly and uniformly extracting a current data sample dataset from the current dataset as a target domain sample dataset; The sample dataset is determined according to the source domain sample dataset and the target domain sample dataset.
3. The method according to claim 1, characterized in that The pre-selected elements include: band data and vegetation and water body indexes, among which The band data includes: red light band R, green light band G, blue light band B and near infrared band NIR; The vegetation and water indexes include: normalized difference vegetation index NDVI, enhanced vegetation index EVI, soil adjusted vegetation index SAVI, greenness index GI, difference vegetation index DVI, green vegetation index GVI, green normalized vegetation index GNDVI and normalized difference water index NDWI.
4. A fine classification device for crops, characterized in that: include: An extraction module is used to randomly and evenly extract a sample data set from a historical data set and a current data set of crops, wherein the sample data set includes: a source domain sample data set and a target domain sample data set, and the historical data set and the current data set are high-resolution satellite data; An acquisition module, configured to use a random forest machine learning algorithm to sort the importance of pre-selected elements according to the source domain sample dataset and the target domain sample dataset to obtain an important element set; A first generation module is configured to randomly sample and group the sample data set to generate M groups of sample data subsets, and use a decision tree model to learn the M groups of sample data subsets and the target domain sample data set according to the important element set to generate M+1 pre-selected classifiers; A second generation module is configured to generate a final classifier based on the M+1 pre-selected classifiers using pre-set rules and the important element set; = a classification module, configured to classify the data to be classified according to the final classifier to obtain a classification result of the current data set, wherein the data to be classified is the current data set excluding the target domain sample data set; wherein, M+1 pre-selected classifiers Includes: Pre-selected classifiers corresponding to M groups of sample data subsets And the pre-selected classifier corresponding to the target domain sample dataset ,and Using the pre-set rules and the important element set, a final classifier is generated based on the M+1 pre-selected classifiers, including: Step 1: Calculate the classification accuracy of each of the M+1 pre-selected classifiers D for the target domain sample data set and sort them in descending order to obtain the sorted classification accuracy ; Step 2: Initialize parameters, including: accuracy threshold ; First intermediate classifier ; Second intermediate classifier: ;m=1,m≤M; Step 3: Iterate based on the initialization parameters and output the second intermediate classifier ; Step 4: Let the final classifier , the new prediction accuracy ,reduce The last element in the new , return to step 1, if Greater than , update the final classifier and the new prediction accuracy ,until The number of important features in is less than 5, and the iteration ends, and the final classifier is output. ; Step 3: Iterate based on the initialization parameters and output the second intermediate classifier ,include: Step 1): Update parameter m=m+1; Step 2): Update the first intermediate classifier ; Step 3): Using the first intermediate classifier Each pre-selected classifier predicts the target domain sample dataset S t , obtain multiple prediction classification results; Step 4): Use voting to determine the classification result based on multiple predicted classification results and calculate the voting prediction accuracy; Step 5): If the voting prediction accuracy , then update , ; Step 6): Return to step 1) for iterative calculation. When m>M, end the loop and obtain the second intermediate classifier. .
5. The device according to claim 4, characterized in that Extraction modules, including: A first extraction submodule is configured to randomly and evenly extract historical sample data from the historical data set as a source domain sample data set; A second extraction submodule is used to randomly and uniformly extract a current data sample dataset from the current dataset as a target domain sample dataset; The determination submodule is configured to determine the sample dataset according to the source domain sample dataset and the target domain sample dataset.
6. The device according to claim 4, characterized in that The pre-selected elements include: band data and vegetation and water body indexes, among which The band data includes: red light band R, green light band G, blue light band B and near infrared band NIR; The vegetation and water indexes include: normalized difference vegetation index NDVI, enhanced vegetation index EVI, soil adjusted vegetation index SAVI, greenness index GI, difference vegetation index DVI, green vegetation index GVI, green normalized vegetation index GNDVI and normalized difference water index NDWI.
7. A computer-readable storage medium, characterized in that The storage medium stores a computer program, and the computer program is used to execute the method according to any one of claims 1 to 3.
8. An electronic device, characterized in that: The electronic device comprises: processor; a memory for storing instructions executable by the processor; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method according to any one of claims 1 to 3.
Citation Information
Patent Citations
High spatial resolution remote sensing image transfer learning classification method based on OpenStreetMap
CN110598564A
Winter wheat remote sensing recognition analysis method and system based on random forest
CN114494882A
High-resolution image and machine learning-based high-altitude region crop classification and identification method
CN114694036A