A peanut planting full-process management platform and method
By collecting and analyzing the overhead images in the field of peanut planting, a growth state judgment model is established, which solves the problem that traditional management models are difficult to achieve efficient and precise management, and accurately judge and manage the growth state of peanuts.
Patent Information
- Application Number
- CN202411352090.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-26
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-09-26
AI Technical Summary
The traditional peanut planting management model is difficult to meet the requirements of modern agriculture for efficient and precise management, especially in the field of peanut planting where planting, management, harvesting and other complex and seasonal aspects.
By continuously collecting the top shot images of the planting area during the entire peanut planting and growth process, selecting the sample area for growth status checks, establishing the relationship between the peanut top shot image characteristics and growth status, and then determining the growth status of the entire planting area, and formulating corresponding results planting management plan.
Accurate judgment of the growth status of peanuts in large-scale planting areas has been achieved, and the accuracy and efficiency of the entire process of peanut planting management has been improved.
Smart Images

Figure CN118864875B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of planting management, and in particular relates to a peanut planting full-process management platform and method. Background Art
[0002] With the continuous development of agricultural science and technology, intelligent management technology is being used more and more widely in agricultural production. In the field of peanut planting, due to the complexity of planting, management, harvesting and other links and strong seasonality, the traditional planting management model has been unable to meet the requirements of modern agriculture for efficient and precise management. Summary of the invention
[0003] The purpose of the present invention is to provide a peanut planting full-process management platform and method, which can accurately judge the growth status of peanuts in a large planting area through small-scale sampling and estimation, thereby improving the accuracy of peanut planting full-process management.
[0004] In order to solve the above technical problems, the present invention is achieved through the following technical solutions:
[0005] The present invention provides a peanut planting full-process management method, comprising:
[0006] During the whole process of peanut planting and growth, overhead images of the planting area on different planting days are continuously collected;
[0007] Selecting several sample areas in the planting area, and continuously checking to obtain the growth status of peanuts in the sample areas at different planting days, wherein the growth status includes a normal state and several types of abnormal states;
[0008] Correlating the growth status of peanuts in the sample area at different planting days with the corresponding local overhead image features to obtain the correlation relationship between the overhead image features of peanuts at different planting days and the growth status;
[0009] Dividing other areas in the planting area except the sample area into a plurality of detection sub-areas;
[0010] Continuously extracting local overhead image features corresponding to each of the detection sub-areas;
[0011] According to the correlation between the overhead image features of peanuts at different planting days and the growth status, the local overhead image features corresponding to each detection sub-area are judged to obtain the growth status of each detection sub-area.
[0012] The present invention also discloses a peanut planting full-process management method, comprising:
[0013] Develop planting management plans for each species' growth status;
[0014] Receiving the growth status of each detection sub-region;
[0015] Execute the corresponding planting management plan according to the growth status of each detected sub-area.
[0016] The present invention also discloses a peanut planting full-process management method, comprising:
[0017] Obtain digital maps of the planted areas;
[0018] Receiving the growth status of each detection sub-region;
[0019] The growth status of each detection sub-region is marked and displayed in the digital map.
[0020] The present invention also discloses a peanut planting full-process management platform, including:
[0021] The sampling pre-inspection unit is used to continuously collect overhead images of the planting area on different planting days during the entire process of peanut planting and growth;
[0022] Selecting several sample areas in the planting area, and continuously checking to obtain the growth status of peanuts in the sample areas at different planting days, wherein the growth status includes a normal state and several types of abnormal states;
[0023] Correlating the growth status of peanuts in the sample area at different planting days with the corresponding local overhead image features to obtain the correlation relationship between the overhead image features of peanuts at different planting days and the growth status;
[0024] Dividing other areas in the planting area except the sample area into a plurality of detection sub-areas;
[0025] A state detection unit, used for continuously extracting local overhead image features corresponding to each detection sub-area;
[0026] The growth state of each detection sub-region is obtained by judging the local overhead image features corresponding to each detection sub-region according to the correlation between the overhead image features of peanuts at different planting days and the growth state;
[0027] A plan generation unit is used to formulate a planting management plan for each type of growth status;
[0028] Receiving the growth status of each detection sub-region;
[0029] Generate a corresponding planting management plan based on the growth status of each detection sub-area;
[0030] A management display unit for obtaining a digital map containing the planting area;
[0031] Receiving the growth status of each detection sub-region;
[0032] The growth status of each detection sub-region is marked and displayed in the digital map.
[0033] The present invention uses a sampling pre-inspection unit to sample and analyze peanuts in a sample area to obtain the correlation between the overhead image features of peanuts at different planting days and the growth status, and then the status detection unit continuously extracts the local overhead image features corresponding to each detection sub-area and combines the above correlation to obtain the accurate growth status of each detection sub-area. The plan generation unit in this system can generate a corresponding planting management plan, and the management display unit can mark and display the growth status in a digital map.
[0034] Of course, any product implementing the present invention does not necessarily need to achieve all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for describing the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0036] Figure 1 It is a schematic diagram of an embodiment of a peanut planting full-process management platform of the present invention;
[0037] Figure 2 A schematic diagram of the steps of the sampling pre-detection unit and the state detection unit in one embodiment of the present invention;
[0038] Figure 3 A schematic diagram of a step flow of a plan generation unit according to an embodiment of the present invention;
[0039] Figure 4 A schematic diagram of a step flow chart of a management display unit according to an embodiment of the present invention;
[0040] Figure 5 This is a schematic diagram of the step flow of step S3 in one embodiment of the present invention;
[0041] Figure 6 This is a schematic diagram of a step flow chart of step S32 in an embodiment of the present invention;
[0042] Figure 7 This is a schematic diagram of a step flow chart of step S324 in an embodiment of the present invention;
[0043] Figure 8A schematic diagram of a step flow chart of step S3244 in an embodiment of the present invention;
[0044] Fig. 9 This is a schematic diagram of the step flow of step S6 in one embodiment of the present invention;
[0045] In the accompanying drawings, the components represented by the reference numerals are listed as follows:
[0046] 1- Sampling pre-check unit, 2- Status detection unit, 3- Plan generation unit, 4- Management display unit. DETAILED DESCRIPTION
[0047] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.
[0048] It should be noted that the terms "first", "second", etc. in this application are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0049] See also Figures 1 to 4 As shown, the present invention provides a peanut planting full-process management platform, which is divided into a sampling pre-inspection unit 1, a state detection unit 2, a plan generation unit 3 and a management display unit 4 in terms of functional modules. The sampling pre-inspection unit 1 samples and analyzes the peanuts in the sample area to obtain the correlation between the overhead image features and the growth status of the peanuts on different planting days, and then the state detection unit 2 realizes the peanut growth status detection of the entire planting area. At the same time, the plan generation unit 3 and the management display unit 4 can respectively make plans and display abnormalities, which is convenient for the planting staff to carry out field management.
[0050] The sampling pre-inspection unit 1 in this system can first execute step S1 during operation to continuously collect overhead images of the planting area at different planting days during the whole process of peanut planting and growth. In this solution, the overhead images need to use the same lens, use the same overhead angle, and maintain the same imaging state to maintain consistency. Next, step S2 can be executed to select several sample areas in the planting area, and continuously check to obtain the growth status of peanuts in the sample area at different planting days. The growth state in this solution includes a normal state and several types of abnormal states. During the growth process of peanuts, a variety of abnormal states may occur, affecting its normal growth and development, such as yellowing, leaf spot disease, powdery mildew, mosaic virus infection, drought stress, waterlogging stress, lodging, lack of trace elements, and pests such as aphids and red spiders.
[0051] After that, the sampling pre-inspection unit 1 can then perform step S3 to associate the growth status of peanuts in the sample area at different planting days with the corresponding local overhead image features to obtain the association relationship between the overhead image features of peanuts at different planting days and the growth status. This part will be explained in detail later. For ease of management, step S4 can also be performed to divide other areas in the planting area except the sample area into several detection sub-areas. In practice, the area and shape of each detection sub-area can be kept the same.
[0052] The state detection unit 2 in this solution can firstly execute step S5 to continuously extract the local overhead image features corresponding to each detection sub-region during operation. Then, step S6 can be executed to determine the local overhead image features corresponding to each detection sub-region according to the correlation between the overhead image features of peanuts at different planting days and the growth status to obtain the growth status of each detection sub-region.
[0053] During operation, the plan generation unit 3 in the system can first execute step S031 to formulate a planting management plan for the growth status of each type. Next, step S032 can be executed to receive the growth status of each detection sub-area. Finally, step S033 can be executed to generate a corresponding planting management plan according to the growth status of each detection sub-area, and the executor can also be notified to execute it, thereby realizing fast and effective peanut field management.
[0054] During operation, the management display unit 4 in the system can first execute step S041 to obtain a digital map containing the planting area. Next, step S042 can be executed to receive the growth status of each detection sub-area. Finally, step S043 can be executed to mark and display the growth status of each detection sub-area in the digital map. The management display unit 4 in this solution can be a large screen set in the command center, or it can be a virtual function unit displayed in a handheld terminal, such as a mobile phone app.
[0055] See also Figure 5 As shown, peanuts have very different biological morphologies in different growth periods. In order to improve the accuracy of abnormal judgment of peanuts, it is necessary to make staged judgments based on the status of different growth periods. Specifically, first, step S31 can be executed to divide the entire process of peanut planting and growth into multiple growth periods, usually dividing the growth period into seedling stage, branching stage, flowering stage, pod-setting stage and maturity stage. Next, step S32 can be executed to obtain the growth period of peanuts in the sample area at different planting days. Next, step S33 can be executed to establish a growth period classification model, using the planting days of peanuts in the sample area and the corresponding local overhead image features as the input layer, and the corresponding growth period as the output layer, and the growth period classification model is trained to convergence. In this solution, the local overhead image features include leaf morphology, leaf density and reflectance spectrum distribution, of course, only some of them can be selected.
[0056] Before making abnormal judgments for peanuts in each growth period, a state recognition model needs to be established. Specifically, step S34 can be executed first to establish a state recognition model for each growth period. Next, step S35 can be executed to input the number of planting days of peanuts in the sample area and the corresponding local overhead image features into the input layer of the state recognition model of the corresponding growth period, and the corresponding growth state is used as the output layer to train the state recognition model until convergence. Finally, step S36 can be executed to use the growth period classification model and the state recognition model corresponding to each growth period as the correlation between the overhead image features and the growth state of peanuts at different planting days, and the growth period classification model and the subsequent state recognition model can be directly input in subsequent use.
[0057] See also Figure 6 As shown, it can be seen from the above content that accurately judging the growth period of peanuts is the basis of everything. Usually, peanut field managers will judge based on experience or reference comparison tables, but these are inaccurate. In order to improve the accuracy of growth period judgment, step S321 can be first executed to obtain the growth characteristic state of peanuts in multiple species. In this solution, the types of growth characteristic states use leaf area, plant height, and plant leaf number. Next, step S322 can be executed to obtain a comparison table of the growth characteristic state of each type of peanut and the growth period in which it is located. The comparison table used here is a reference manual issued by the Ministry of Agriculture and Rural Affairs for technology promotion.
[0058] However, the comparison table is roughly estimated comprehensively, and there are differences in the growth of peanuts under different environmental conditions. Therefore, for each planting day, the following steps are performed respectively. First, step S323 can be performed to retrieve the growth characteristic state of each peanut in the sample area in multiple species from the comparison table to obtain the estimated growth period of each peanut in the sample area based on the growth characteristic state of each species. Next, step S324 can be performed to infer the growth period of the peanut in the current planting days in the sample area based on the estimated growth period of each peanut in the sample area based on the growth characteristic state of each species. Finally, step S325 can be performed to summarize the growth period of peanuts in the sample area at different planting days. The growth period obtained at this time is the accurate growth period under the current planting environment conditions, which lays the foundation for subsequent accurate judgment of the growth state.
[0059] See also Figure 7 As shown, since the growth period of peanuts is not strictly divided, the peanuts in the same plot may be in two or more growth periods. However, the growth of peanuts in the same plot also has commonalities, so it is necessary to comprehensively consider the growth period of peanuts in the sample area. Specifically, first, step S3241 can be executed to obtain the accuracy of the comparison table. Next, step S3242 can be executed to number the growth period of each species according to the growth order to obtain the growth period number of each growth period. Next, step S3243 can be executed to sort the estimated growth period of each peanut in the sample area based on the growth characteristic state of each species according to the corresponding growth period number to obtain the estimated growth period number sequence of each peanut in the sample area based on the growth characteristic state of each species. Next, step S3244 can be executed to sort the estimated growth period number sequence of each peanut in the sample area based on the growth characteristic state of each species to obtain the probability that the peanuts in the sample area are in several growth periods. Next, step S3245 can be executed to obtain the growth period with the largest probability value as the reference growth period. Next, step S3246 may be executed to calculate the ratio of the probability of each other growth period to the probability of the reference growth period, and determine whether the ratio is greater than the accuracy of the comparison table.
[0060] If yes, it means that some peanuts in the sample area are in the growth period, so step S3247 can be executed to retain. If no, it means that the data does not support that some peanuts in the sample area are in the growth period, so step S3248 can be executed to remove. Finally, step S3249 can be executed to use the several growth periods retained as the growth period of peanuts in the sample area in the current planting days.
[0061] In order to supplement the implementation process of the above steps S3241 to S3249, the source code of some functional modules is provided, and the explanation is made in the comment section. In order to avoid the leakage of data involving commercial secrets, some data that does not affect the implementation of the solution are desensitized, the same below.
[0062] #include <iostream>
[0063] #include <vector>
[0064] #include <algorithm>
[0065] #include <map>
[0066] / / Define the growth period of peanuts
[0067] enum GrowthStage {
[0068] SEEDLING = 0, / / Seedling stage
[0069] BRANCHING, / / Branching
[0070] FLOWERING, / / Flowering
[0071] PODDING, / / Pod-setting period
[0072] MATURITY
[0073] };
[0074] / / Define the growth feature structure
[0075] struct GrowthTraits {
[0076] float leafArea; / / leaf area
[0077] float plantHeight; / / plant height
[0078] int leafCount; / / Number of leaves
[0079] };
[0080] / / Growth period classification structure in the comparison table
[0081] struct GrowthStageTable {
[0082] float minLeafArea;
[0083] float maxLeafArea;
[0084] float minPlantHeight;
[0085] float maxPlantHeight;
[0086] int minLeafCount;
[0087] int maxLeafCount;
[0088] GrowthStage stage;
[0089] };
[0090] / / Example comparison table to obtain the accuracy of different growth stages (expressed as a percentage)
[0091] float getAccuracyOfGrowthStageTable() {
[0092] return 0.85f; / / Example: The accuracy of the comparison table is 85%
[0093] }
[0094] / / Example growth period comparison table
[0095] std::vector <growthstagetable>getGrowthStageReferenceTable() {
[0096] return {
[0097] {0.0f, 10.0f, 0.0f, 15.0f, 0, 5, SEEDLING},
[0098] {10.0f, 30.0f, 15.0f, 30.0f, 5, 15, BRANCHING},
[0099] {30.0f, 50.0f, 30.0f, 50.0f, 15, 25, FLOWERING},
[0100] {50.0f, 70.0f, 50.0f, 70.0f, 25, 35, PODDING},
[0101] {70.0f, 100.0f, 70.0f, 100.0f, 35, 50, MATURITY}
[0102] };
[0103] }
[0104] / / Estimate the growth period based on the growth characteristic status
[0105] GrowthStage estimateGrowthStage(const GrowthTraits&traits, conststd::vector <growthstagetable>&referenceTable) {
[0106] for (const auto&entry : referenceTable) {
[0107] if (traits.leafArea>= entry.minLeafArea&&traits.leafArea<=entry.maxLeafArea&&
[0108] traits.plantHeight>= entry.minPlantHeight&&traits.plantHeight<=entry.maxPlantHeight&&
[0109] traits.leafCount>= entry.minLeafCount&&traits.leafCount<=entry.maxLeafCount) {
[0110] return entry.stage;
[0111] }
[0112] }
[0113] return SEEDLING; / / Returns to the seedling stage by default
[0114] }
[0115] / / Get the growth period number based on the estimated growth period
[0116] int getGrowthStageIndex(GrowthStage stage) {
[0117] return static_cast <int>(stage);
[0118] }
[0119] / / Sample region class, containing the growth characteristics of multiple peanut plants
[0120] class SampleArea {
[0121] public:
[0122] std::vector <growthtraits>plantTraits; / / Growth characteristics of all peanut plants in the sample area
[0123] / / Get the growth period number sequence of all plants in the sample area
[0124] std::vector <int>getGrowthStageIndicesForSample(const std::vector <growthstagetable>&referenceTable) {
[0125] std::vector <int>growthStageIndices;
[0126] for (const auto&traits : plantTraits) {
[0127] GrowthStage stage = estimateGrowthStage(traits, referenceTable);
[0128] int stageIndex = getGrowthStageIndex(stage);
[0129] growthStageIndices.push_back(stageIndex);
[0130] }
[0131] return growthStageIndices;
[0132] }
[0133] / / Get the probability distribution of each growth period in the sample area
[0134] std::map<int, float> getGrowthStageProbabilities(const std::vector <int>&stageIndices) {
[0135] std::map<int, float> stageCount;
[0136] for (int index : stageIndices) {
[0137] stageCount[index]++;
[0138] }
[0139] for (auto&entry : stageCount) {
[0140] entry.second / = stageIndices.size(); / / Calculate the probability of each growth period
[0141] }
[0142] return stageCount;
[0143] }
[0144] / / Get the growth period with the maximum probability value
[0145] int getBaselineGrowthStage(const std::map<int, float> &probabilities){
[0146] int baselineStage = -1;
[0147] float maxProbability = -1.0f;
[0148] for (const auto&entry : probabilities) {
[0149] if (entry.second>maxProbability) {
[0150] maxProbability = entry.second;
[0151] baselineStage = entry.first;
[0152] }
[0153] }
[0154] return baselineStage;
[0155] }
[0156] / / Filter the final growth period based on the baseline growth period
[0157] std::vector <int>filterGrowthStages(const std::map<int, float>&probabilities, int baselineStage, float accuracyThreshold) {
[0158] std::vector <int>finalStages;
[0159] float baselineProbability = probabilities.at(baselineStage);
[0160] for (const auto&entry : probabilities) {
[0161] float probabilityRatio = entry.second / baselineProbability;
[0162] if (probabilityRatio>= accuracyThreshold) {
[0163] finalStages.push_back(entry.first);
[0164] }
[0165] }
[0166] return finalStages;
[0167] }
[0168] / / Summarize the growth period of peanuts in the sample area in the current planting days
[0169] std::vector <int>summarizeGrowthStagesForCurrentDay(const std::vector <growthstagetable>&referenceTable) {
[0170] / / Get the growth period number sequence
[0171] auto stageIndices = getGrowthStageIndicesForSample(referenceTable);
[0172] / / Get the probability distribution of the growth period
[0173] auto stageProbabilities = getGrowthStageProbabilities(stageIndices);
[0174] / / Get the benchmark growth period with the maximum probability value
[0175] int baselineStage = getBaselineGrowthStage(stageProbabilities);
[0176] / / Get the accuracy of the comparison table
[0177] float accuracy = getAccuracyOfGrowthStageTable();
[0178] / / Filter the final growth period based on accuracy
[0179] return filterGrowthStages(stageProbabilities, baselineStage,accuracy);
[0180] }
[0181] };
[0182] / / Main function, illustrating the entire management process
[0183] int main() {
[0184] PlantingRegion region;
[0185] / / Example: Add growth feature data of sample area
[0186] SampleArea sample1;
[0187] sample1.plantTraits.push_back({12.0f, 20.0f, 10}); / / Sample Peanut 1
[0188] sample1.plantTraits.push_back({15.0f, 25.0f, 12}); / / Sample Peanut 2
[0189] SampleArea sample2;
[0190] sample2.plantTraits.push_back({35.0f, 40.0f, 20}); / / Sample Peanut 3
[0191] sample2.plantTraits.push_back({50.0f, 55.0f, 30}); / / Sample Peanut 4
[0192] region.sampleAreas.push_back(sample1);
[0193] region.sampleAreas.push_back(sample2);
[0194] / / Get the growth period comparison table
[0195] std::vector <growthstagetable>referenceTable =getGrowthStageReferenceTable();
[0196] / / Summarize the growth period of each sample area in the current planting days
[0197] for (auto&sample : region.sampleAreas) {
[0198] auto finalStages = sample.summarizeGrowthStagesForCurrentDay(referenceTable);
[0199] / / Display the growth period after filtering
[0200] std::cout<<"Growth period number after screening: ";
[0201] for (int stage : finalStages) {
[0202] std::cout< <stage<<" ";
[0203] }
[0204] std::cout< <std::endl;
[0205] }
[0206] return 0;
[0207] }
[0208] The above code implements the inference of the growth period of peanuts in the current planting days through the growth characteristics of peanuts, and selects possible growth periods through the comparison table and the growth period accuracy. First, the growth period number corresponding to the growth characteristic state of each peanut in the sample area is calculated, and then the probability distribution of each growth period is counted. Then the growth period with the highest probability is selected as the benchmark growth period, and the ratio of the probability of other growth periods to the benchmark growth period is calculated. If the ratio is greater than the set comparison table accuracy threshold, the growth period will be retained. Finally, multiple possible growth periods of peanuts in the sample area in the current planting days are obtained.
[0209] See also Figure 8 As shown, the staff's estimation of the growth characteristic state of each peanut in the sample area may be biased, which makes the growth period analysis of peanuts in the sample area need to take into account the above-mentioned deviations and errors. When performing error rate analysis on the data, step S32441 can be first executed to vectorize the estimated growth period number sequence of each peanut in the sample area based on the growth characteristic state of each species to obtain the growth period characteristic vector of each peanut in the sample area. Next, step S32442 can be executed to select several of the multiple growth period characteristic vectors as the basic growth period characteristic vectors. Next, step S32443 can be executed to obtain the vector difference norm of each basic growth period characteristic vector and other growth period characteristic vectors. Next, step S32444 can be executed to classify each other growth period characteristic vector and the basic growth period characteristic vector with the smallest vector difference norm into the same vector group.
[0210] In the process of classifying vector groups, step S324441 can be first executed to calculate and obtain the mean vector of each vector group. Next, step S324442 can be executed to calculate and obtain the growth period feature vector with the smallest vector difference norm with the mean vector in each vector group as the updated basic growth period feature vector. Next, step S324443 can be executed to determine whether the updated basic growth period feature vector has changed. If so, it means that the grouping is sufficiently reliable, so step S324444 can be executed next to obtain the classified vector group. If not, it means that there are still large differences within the classified vector group, so next it can return to iteratively execute steps S32443 to step S324443 to continuously update the basic growth period feature vector and the vector group until a fully grouped vector group is obtained.
[0211] Afterwards, the state detection unit 2 can execute step S32445 to obtain the growth period corresponding to the mode of all estimated growth period numbers in each vector group as the growth period of the peanut corresponding to the vector group. Next, step S32446 can be executed to obtain the number of growth period feature vectors contained in each vector group. Next, step S32447 can be executed to use the ratio of the number of growth period feature vectors contained in each vector group to all growth period feature vectors as the probability of the growth period of the peanut corresponding to each vector group. Finally, step S32448 can be executed to obtain the probability of the peanuts in the sample area being in several growth periods according to the probability of the growth period of the peanuts corresponding to each vector group.
[0212] In order to provide additional explanation for the implementation process of the above-mentioned steps S32441 to S32447, the source code of some functional modules is provided, and a comparative explanation is provided in the comment section.
[0213] #include <iostream>
[0214] #include <vector>
[0215] #include <cmath>
[0216] #include <map>
[0217] #include <numeric>
[0218] #include <algorithm>
[0219] / / Define the growth period
[0220] enum GrowthStage {
[0221] SEEDLING = 0, / / Seedling stage
[0222] BRANCHING, / / Branching
[0223] FLOWERING, / / Flowering
[0224] PODDING, / / Pod-setting period
[0225] MATURITY
[0226] };
[0227] / / Growth period feature vector structure
[0228] struct GrowthStageVector {
[0229] std::vector <float>features; / / Feature vector, including leaf area, plant height and other features
[0230] GrowthStage stage; / / Corresponding growth stage
[0231] };
[0232] / / Calculate the norm difference of two vectors
[0233] float calculateNormDifference(const std::vector <float>&v1, conststd::vector <float>&v2) {
[0234] float sum = 0.0f;
[0235] for (size_t i = 0; i <v1.size(); ++i) {
[0236] float diff = v1[i] - v2[i];
[0237] sum += diff * diff;
[0238] }
[0239] return std::sqrt(sum); / / Returns the norm of the vector difference
[0240] }
[0241] / / Calculate the mean vector of the vector group
[0242] std::vector <float>calculateMeanVector(const std::vector <growthstagevector>&group) {
[0243] std::vector <float>meanVector(group[0].features.size(), 0.0f);
[0244] for (const auto&vec : group) {
[0245] for (size_t i = 0; i <vec.features.size(); ++i) {
[0246] meanVector[i] += vec.features[i];
[0247] }
[0248] }
[0249] for (auto&feature : meanVector) {
[0250] feature / = group.size(); / / Calculate the mean
[0251] }
[0252] return meanVector;
[0253] }
[0254] / / Select the vector with the smallest difference from the mean vector from the vector group
[0255] GrowthStageVector getClosestToMean(const std::vector <growthstagevector>&group, const std::vector <float>&meanVector) {
[0256] GrowthStageVector closestVector = group[0];
[0257] float minNormDiff = calculateNormDifference(group[0].features,meanVector);
[0258] for (const auto&vec : group) {
[0259] float normDiff = calculateNormDifference(vec.features, meanVector);
[0260] if (normDiff <minNormDiff) {
[0261] minNormDiff = normDiff;
[0262] closestVector = vec;
[0263] }
[0264] }
[0265] return closestVector; / / Returns the vector with the smallest difference from the mean vector
[0266] }
[0267] / / Sort the growth period number sequence of peanuts in the sample area to get the probability of each growth period
[0268] void organizeGrowthStageVectors(std::vector <growthstagevector>&vectors) {
[0269] bool updated = true;
[0270] std::vector <growthstagevector>baseVectors;
[0271] / / Initialize the basic growth period feature vector and select the first N vectors as the basic vectors
[0272] size_t baseSize = std::min(static_cast<size_t> (3), vectors.size()); / / Select 3 basic vectors in the example
[0273] baseVectors.insert(baseVectors.end(), vectors.begin(), vectors.begin() + baseSize);
[0274] / / Loop to update the basic vector group
[0275] while (updated) {
[0276] updated = false;
[0277] std::map <GrowthStageVector, std::vector <growthstagevector>>clusters;
[0278] / / Find the closest basis vector set for each vector
[0279] for (const auto&vec : vectors) {
[0280] float minNormDiff = std::numeric_limits <float>::max();
[0281] GrowthStageVector closestBase;
[0282] for (const auto&base : baseVectors) {
[0283] float normDiff = calculateNormDifference(vec.features,base.features);
[0284] if (normDiff <minNormDiff) {
[0285] minNormDiff = normDiff;
[0286] closestBase = base;
[0287] }
[0288] }
[0289] clusters[closestBase].push_back(vec); / / Assign the vector to the closest basic vector group
[0290] }
[0291] / / Update the basis vector
[0292] std::vector <growthstagevector>newBaseVectors;
[0293] for (const auto&pair : clusters) {
[0294] auto meanVector = calculateMeanVector(pair.second);
[0295] auto closestVector = getClosestToMean(pair.second, meanVector);
[0296] newBaseVectors.push_back(closestVector); / / Update base vector
[0297] / / Determine whether the basic vector has changed
[0298] if (calculateNormDifference(pair.first.features,closestVector.features)>1e-5) {
[0299] updated = true; / / If the base vector changes, continue the loop
[0300] }
[0301] }
[0302] baseVectors = newBaseVectors; / / Update the base vector set
[0303] }
[0304] / / Calculate the growth period mode and probability in each vector group
[0305] std::map<GrowthStage, float> stageProbabilities;
[0306] for (const auto&pair : clusters) {
[0307] std::map<GrowthStage, int> stageCount;
[0308] / / Count the number of each growth period
[0309] for (const auto&vec : pair.second) {
[0310] stageCount[vec.stage]++;
[0311] }
[0312] / / Get the growth period corresponding to the majority
[0313] auto mostCommonStage = std::max_element(
[0314] stageCount.begin(), stageCount.end(),
[0315] [](const std::pair<GrowthStage, int> &a, const std::pair<GrowthStage,int> &b) {
[0316] return a.second <b.second;
[0317] })->first;
[0318] / / Calculate the probability of this growth period
[0319] float probability = static_cast <float>(pair.second.size()) / vectors.size();
[0320] stageProbabilities[mostCommonStage] = probability;
[0321] }
[0322] / / Output the probability of each growth stage
[0323] for (const auto& entry : stageProbabilities) {
[0324] std::cout << "Growth stage: " << entry.first << " Probability: " << entry.second << std::endl;
[0325] }
[0326] }
[0327] int main() {
[0328] / / Characteristic vectors of peanut growth stages in the example sample area
[0329] std::vector <growthstagevector>sampleVectors = {
[0330] {{12.0f, 20.0f, 10.0f}, SEEDLING},
[0331] {{15.0f, 22.0f, 12.0f}, SEEDLING},
[0332] {{30.0f, 35.0f, 18.0f}, BRANCHING},
[0333] {{50.0f, 60.0f, 30.0f}, PODDING},
[0334] {{35.0f, 40.0f, 25.0f}, FLOWERING},
[0335] {{70.0f, 80.0f, 40.0f}, MATURITY}
[0336] };
[0337] / / Arrange the growth period vectors and calculate the probability of each growth period
[0338] organizeGrowthStageVectors(sampleVectors);
[0339] return 0;
[0340] }
[0341] The above code implements grouping and sorting the growth period feature vectors of each peanut plant, and calculating the probabilities of different growth periods. First, the growth period feature state of each peanut plant is vectorized, and then the norm difference between the vectors is calculated to classify them into the closest basic growth period feature vector group. By continuously updating the basic vectors, the growth period mode in the vector group is finally used as the growth period corresponding to the group, and the probability of the growth period in each vector group is calculated to obtain the probability of the peanuts in the sample area being in different growth periods.
[0342] See also Fig. 9 As shown, considering that different peanut plants in the same detection sub-area may be in different growth stages, in order to comprehensively judge the growth state of the detection sub-area, firstly, step S61 can be executed to input the planting days of peanuts in each detection sub-area and the corresponding local overhead image features into the growth stage classification model to obtain several growth stages of peanuts. Next, step S62 can be executed to input the planting days of peanuts in the detection sub-area and the corresponding local overhead image features into the state recognition model of each corresponding growth stage to obtain the probability of each growth state of the output layer of each state recognition model. Finally, step S63 can be executed to accumulate the probability of each growth state of the output layer of each state recognition model and take the maximum probability item as the growth state of the detection sub-area. Of course, the output items with probabilities greater than the set value can also be used as the growth state of the detection sub-area, which can guide field workers to effectively manage peanuts.
[0343] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the device, system, method and computer program product according to multiple embodiments of the present application. In this regard, each square frame in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of the module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some alternative implementations, the functions marked in the square frame can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square frames can actually be executed substantially in parallel, and they can also be executed in reverse order sometimes, depending on the functions involved.
[0344] It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented by hardware that performs the corresponding function or action, such as a circuit or ASIC (Application Specific Integrated Circuit), or can be implemented by a combination of hardware and software, such as firmware.
[0345] Although the present invention is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "a" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in the claims. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.
[0346] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes are obvious to those of ordinary skill in the art without departing from the scope of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.< / growthstagevector> < / float> < / growthstagevector> < / float> < / growthstagevector> < / growthstagevector> < / growthstagevector> < / float> < / growthstagevector> < / float> < / growthstagevector> < / float> < / float> < / float> < / float> < / algorithm> < / numeric> < / map> < / cmath> < / vector> < / iostream> < / growthstagetable> < / growthstagetable> < / int> < / int> < / int> < / int> < / int> < / growthstagetable> < / int> < / growthtraits> < / int> < / growthstagetable> < / growthstagetable> < / map> < / algorithm> < / vector> < / iostream>
Claims
1. A peanut planting full-process management method, characterized in that: include, During the whole process of peanut planting and growth, overhead images of the planting area on different planting days are continuously collected; Selecting several sample areas in the planting area, and continuously checking to obtain the growth status of peanuts in the sample areas at different planting days, wherein the growth status includes a normal state and several types of abnormal states; Correlating the growth status of peanuts in the sample area at different planting days with the corresponding local overhead image features to obtain the correlation relationship between the overhead image features of peanuts at different planting days and the growth status; Dividing other areas in the planting area except the sample area into a plurality of detection sub-areas; Continuously extracting local overhead image features corresponding to each of the detection sub-areas; The growth state of each detection sub-region is obtained by judging the local overhead image features corresponding to each detection sub-region according to the correlation between the overhead image features of peanuts at different planting days and the growth state; The step of associating the growth status of peanuts in the sample area at different planting days with the corresponding local overhead image features to obtain the correlation relationship between the overhead image features of peanuts at different planting days and the growth status includes: The whole process of peanut planting and growth is divided into multiple growth stages, wherein the growth stages include seedling stage, branching stage, flowering stage, pod-setting stage and maturity stage; Obtain the growth period of peanuts in the sample area at different planting days; Establishing a growth period classification model, taking the number of planting days of peanuts in the sample area and the corresponding local overhead image features as the input layer, taking the corresponding growth period as the output layer, and training the growth period classification model until convergence, wherein the local overhead image features include leaf morphology, leaf density and / or reflectance spectrum distribution; Establishing a state recognition model for each growth phase; Input the number of days of peanut planting in the sample area and the corresponding local overhead image features into the input layer of the state recognition model of the corresponding growth period, use the corresponding growth state as the output layer, and train the state recognition model until convergence; The growth period classification model and the state recognition model corresponding to each growth period are used as the correlation relationship between the overhead image features of peanuts at different planting days and the growth state; The step of obtaining the growth period of peanuts in the sample area at different planting days includes: Acquire multiple types of growth characteristic states of peanuts, wherein the types of growth characteristic states include leaf area, plant height and / or plant leaf number; Obtain a comparison table of the growth characteristics and growth stages of each type of peanut; For each planting day, perform the following steps separately, The growth characteristic states of each peanut plant in the sample area in multiple species are retrieved from the comparison table to obtain an estimated growth period of each peanut plant in the sample area based on the growth characteristic state of each species. The growth period of peanuts in the sample area at the current planting day is inferred based on the estimated growth period of each peanut plant in the sample area based on the growth characteristic state of each species; The growth period of peanuts in the sample area at different planting days was summarized; The step of inferring the growth period of peanuts in the sample area at the current planting day based on the estimated growth period of each peanut plant in the sample area based on the growth characteristic state of each species includes: Obtaining the accuracy of the comparison table; Number the growth period of each species according to the growth order to obtain the growth period number of each growth period; The estimated growth period of each peanut plant in the sample area based on the growth characteristic state of each variety is sorted according to the corresponding growth period number to obtain an estimated growth period number sequence of each peanut plant in the sample area based on the growth characteristic state of each variety; The estimated growth period number sequence of each peanut plant in the sample area based on the growth characteristic state of each species is sorted to obtain the probability of the peanuts in the sample area being in several growth periods; Obtain the growth period with the largest probability value as the benchmark growth period; Calculate the ratio of the probability of obtaining each other growth period to the probability of the reference growth period, and determine whether the ratio is greater than the accuracy of the comparison table; If yes, keep it; If not, remove it; The remaining growth periods are used as the growth period of peanuts in the sample area at the current planting day; The step of arranging the estimated growth period number sequence of each peanut plant in the sample area based on the growth characteristic state of each species to obtain the probability that the peanuts in the sample area are in several growth periods includes: The estimated growth period number sequence of each peanut plant in the sample area based on the growth characteristic state of each species is vectorized to obtain the growth period characteristic vector of each peanut plant in the sample area; Selecting a plurality of the growth period feature vectors as basic growth period feature vectors; Obtaining a vector difference norm between each basic growth period feature vector and other growth period feature vectors; Classifying each of the other growth period feature vectors and the basic growth period feature vector with the smallest vector difference norm into the same vector group; In each of the vector groups, the growth period corresponding to the mode of all the estimated growth period numbers is obtained as the growth period of the peanuts corresponding to the vector group; Obtaining the number of the growth period feature vectors contained in each vector group; The ratio of the number of the growth period feature vectors contained in each vector group to all the growth period feature vectors is used as the probability of the growth period of the peanut corresponding to each vector group; According to the probability of the growth period of the peanuts corresponding to each vector group, the probability of the peanuts in the sample area being in several growth periods is obtained.
2. The method according to claim 1, characterized in that The step of classifying each of the other growth period feature vectors and the basic growth period feature vector with the smallest vector difference norm into the same vector group includes: Calculate and obtain the mean vector of each of the vector groups; In each of the vector groups, the growth period feature vector having the smallest vector difference norm with the mean vector is calculated and obtained as the updated basic growth period feature vector; Determine whether the updated basic growth period feature vector has changed; If yes, the classified vector group is obtained; If not, the basic growth period feature vector and the vector group will be continuously updated.
3. The method according to claim 1, characterized in that The step of determining the local overhead image features corresponding to each detection sub-region according to the correlation between the overhead image features of peanuts at different planting days and the growth status to obtain the growth status of each detection sub-region includes: Input the number of planting days of peanuts in each detection sub-area and the corresponding local overhead image features into the growth period classification model to obtain several growth periods of peanuts; Input the number of planting days of peanuts in the detection sub-area and the corresponding local overhead image features into the state recognition model of each corresponding growth period to obtain the probability of each growth state of the output layer of each state recognition model; The probability of each growth state of the output layer of each state recognition model is accumulated and the item with the maximum probability is taken as the growth state of the detection sub-region.
4. The method according to any one of claims 1 to 3, characterized in that: Also includes, Develop planting management plans for each species' growth status; Receiving the growth status of each detection sub-area in the peanut planting full-process management method according to any one of claims 1 to 3; Generate a corresponding planting management plan based on the growth status of each detected sub-area.
5. The method according to any one of claims 1 to 3, characterized in that: Also includes, Obtain digital maps of the planted areas; Receiving the growth status of each detection sub-area in the peanut planting full-process management method according to any one of claims 1 to 3; The growth status of each detection sub-region is marked and displayed in the digital map.
6. A peanut planting full-process management platform, characterized in that: include, The sampling pre-inspection unit is used to continuously collect overhead images of the planting area on different planting days during the entire process of peanut planting and growth; Selecting several sample areas in the planting area, and continuously checking to obtain the growth status of peanuts in the sample areas at different planting days, wherein the growth status includes a normal state and several types of abnormal states; Correlating the growth status of peanuts in the sample area at different planting days with the corresponding local overhead image features to obtain the correlation relationship between the overhead image features of peanuts at different planting days and the growth status; Dividing other areas in the planting area except the sample area into a plurality of detection sub-areas; A state detection unit, used for continuously extracting local overhead image features corresponding to each detection sub-area; The growth state of each detection sub-region is obtained by judging the local overhead image features corresponding to each detection sub-region according to the correlation between the overhead image features of peanuts at different planting days and the growth state; A plan generation unit is used to formulate a planting management plan for each type of growth status; Receiving the growth status of each detection sub-region; Execute corresponding planting management plans according to the growth status of each detection sub-area; A management display unit for obtaining a digital map containing the planting area; Receiving the growth status of each detection sub-region; Annotating and displaying the growth status of each detection sub-region in the digital map; The step of associating the growth status of peanuts in the sample area at different planting days with the corresponding local overhead image features to obtain the correlation relationship between the overhead image features of peanuts at different planting days and the growth status includes: The whole process of peanut planting and growth is divided into multiple growth stages, wherein the growth stages include seedling stage, branching stage, flowering stage, pod-setting stage and maturity stage; Obtain the growth period of peanuts in the sample area at different planting days; Establishing a growth period classification model, taking the number of planting days of peanuts in the sample area and the corresponding local overhead image features as the input layer, taking the corresponding growth period as the output layer, and training the growth period classification model until convergence, wherein the local overhead image features include leaf morphology, leaf density and / or reflectance spectrum distribution; Establishing a state recognition model for each growth phase; Input the number of days of peanut planting in the sample area and the corresponding local overhead image features into the input layer of the state recognition model of the corresponding growth period, use the corresponding growth state as the output layer, and train the state recognition model until convergence; The growth period classification model and the state recognition model corresponding to each growth period are used as the correlation relationship between the overhead image features of peanuts at different planting days and the growth state; The step of obtaining the growth period of peanuts in the sample area at different planting days includes: Acquire multiple types of growth characteristic states of peanuts, wherein the types of growth characteristic states include leaf area, plant height and / or plant leaf number; Obtain a comparison table of the growth characteristics and growth stages of each type of peanut; For each planting day, perform the following steps separately, The growth characteristic states of each peanut plant in the sample area in multiple species are retrieved from the comparison table to obtain an estimated growth period of each peanut plant in the sample area based on the growth characteristic state of each species. The growth period of peanuts in the sample area at the current planting day is inferred based on the estimated growth period of each peanut plant in the sample area based on the growth characteristic state of each species; The growth period of peanuts in the sample area at different planting days was summarized; The step of inferring the growth period of peanuts in the sample area at the current planting day based on the estimated growth period of each peanut plant in the sample area based on the growth characteristic state of each species includes: Obtaining the accuracy of the comparison table; Number the growth period of each species according to the growth order to obtain the growth period number of each growth period; The estimated growth period of each peanut plant in the sample area based on the growth characteristic state of each variety is sorted according to the corresponding growth period number to obtain an estimated growth period number sequence of each peanut plant in the sample area based on the growth characteristic state of each variety; The estimated growth period number sequence of each peanut plant in the sample area based on the growth characteristic state of each species is sorted to obtain the probability of the peanuts in the sample area being in several growth periods; Obtain the growth period with the largest probability value as the benchmark growth period; Calculate the ratio of the probability of obtaining each other growth period to the probability of the reference growth period, and determine whether the ratio is greater than the accuracy of the comparison table; If yes, keep it; If not, remove it; The remaining growth periods are used as the growth period of peanuts in the sample area at the current planting day; The step of arranging the estimated growth period number sequence of each peanut plant in the sample area based on the growth characteristic state of each species to obtain the probability that the peanuts in the sample area are in several growth periods includes: The estimated growth period number sequence of each peanut plant in the sample area based on the growth characteristic state of each species is vectorized to obtain the growth period characteristic vector of each peanut plant in the sample area; Selecting a plurality of the growth period feature vectors as basic growth period feature vectors; Obtaining a vector difference norm between each basic growth period feature vector and other growth period feature vectors; Classifying each of the other growth period feature vectors and the basic growth period feature vector with the smallest vector difference norm into the same vector group; In each of the vector groups, the growth period corresponding to the mode of all the estimated growth period numbers is obtained as the growth period of the peanuts corresponding to the vector group; Obtaining the number of the growth period feature vectors contained in each vector group; The ratio of the number of the growth period feature vectors contained in each vector group to all the growth period feature vectors is used as the probability of the growth period of the peanut corresponding to each vector group; According to the probability of the growth period of the peanuts corresponding to each vector group, the probability of the peanuts in the sample area being in several growth periods is obtained.
Citation Information
Patent Citations
Phenological period identification method and device, electronic equipment and storage medium
CN115620151A