Wheat yield prediction method based on machine learning
Through deep learning technology combining remote sensing data and environmental factors, a wheat yield prediction model is constructed, which solves the problem that traditional methods are difficult to deal with large-scale data and capture nonlinear relationships, and achieves high-precision wheat yield prediction and supports scientific decision-making in agricultural production.
Patent Information
- Application Number
- CN202411718031.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Traditional wheat yield prediction methods are difficult to process large-scale and high-dimensional data, and cannot accurately capture the complex nonlinear relationship between wheat yield and environmental factors, resulting in a lack of accuracy and real-time prediction.
Deep learning technology is used, combined with remote sensing data and environmental factors, to build a wheat yield prediction model. The model includes a first feature extractor, a color perceptron, a second feature extractor, a feature compressor, an environment evaluation function and a yield prediction function, and improves prediction accuracy through iterative optimization.
It significantly improves the prediction accuracy of wheat yield, can provide scientific decision-making basis for agricultural production, optimize resource allocation, and improve wheat production efficiency. It has important economic value and good application prospects.
Smart Images

Figure CN119670950A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of agricultural forecasting, and in particular to a wheat yield forecasting method based on machine learning. Background Art
[0002] Wheat is one of the most important food crops in the world. It is widely planted in many countries and regions and is of great significance for maintaining human survival and development. With the continuous growth of the global population, food safety issues have become increasingly prominent, and the demand for wheat has also increased. Therefore, improving the yield and quality of wheat has become an important task that needs to be urgently solved in agricultural production. However, wheat yield is affected by a variety of complex factors, including climate change, soil properties, agronomic management, pests and diseases, etc. These interacting factors make traditional wheat yield prediction methods seem incapable. Traditional methods usually rely on statistical models or empirical formulas. Although these methods can provide predictions to a certain extent, they have obvious limitations. First, the data processing capabilities of traditional methods are weak, and it is difficult to handle large-scale and high-dimensional data sets, resulting in a lack of accuracy in the prediction of wheat yield. Secondly, there is a complex nonlinear relationship between wheat yield and environmental factors, which is difficult to capture by traditional linear models. In addition, in a rapidly changing agricultural environment, traditional methods are often slow to respond and cannot achieve real-time yield prediction.
[0003] With the rapid development of computer technology, especially the rise of data science and machine learning technology, wheat yield prediction methods based on machine learning have gradually attracted attention. Machine learning has the ability to automatically analyze and learn large amounts of data, revealing potential patterns and relationships, thus providing a new idea for wheat yield prediction. By processing historical data, machine learning can quickly extract important features that affect wheat yield, and update the model based on new data to adapt to different agricultural environments. In addition, machine learning is also good at capturing complex nonlinear relationships between variables and can provide more accurate prediction results. Therefore, the development of wheat yield prediction methods based on machine learning can not only improve the accuracy of predictions, but also provide farmers and agricultural managers with a scientific basis for decision-making, optimize resource allocation, and improve wheat production efficiency. This has important practical significance for addressing global food security challenges and promoting sustainable agricultural development. In future research, combining meteorological data, soil information, farming techniques, and modern remote sensing technology to build a comprehensive prediction model will further promote the development of wheat yield prediction methods and provide more effective support for agricultural production practices. Summary of the invention
[0004] In order to overcome the shortcomings of the above technologies, the present invention provides a wheat yield prediction method based on machine learning that combines remote sensing data and environmental factors and utilizes deep learning technology to not only improve the prediction accuracy of wheat yield.
[0005] The technical solution adopted by the present invention to overcome the technical problems is:
[0006] A wheat yield prediction method based on machine learning comprises the following steps:
[0007] a) Construct the Y-wheat dataset, which consists of the image environment dataset A and the actual yield E;
[0008] b) dividing the image environment dataset A into a training set and a test set;
[0009] c) Preprocess the images in the training set to obtain wheat remote sensing data P wheat ;
[0010] d) constructing a wheat yield prediction model consisting of a first feature extractor, a color sensor, a second feature extractor, a feature compressor, an environmental assessment function, and a yield prediction function;
[0011] e) The wheat remote sensing data P wheat Input into the first feature extractor of the wheat yield prediction model, and output the first remote sensing feature F rs-1 ;
[0012] f) The wheat remote sensing data P wheat and the first remote sensing feature F rs-1 Input into the color sensor of the wheat yield prediction model, and output the color perception feature F c ;
[0013] g) The color perception feature F c Input into the second feature extractor of the wheat yield prediction model, and output the second perceptual feature F rs-2 ;
[0014] h) The second perceptual feature F rs-2 Input into the feature compressor of the wheat yield prediction model, and output the compressed vector V c ;
[0015] i) Input the environmental data in the training set into the environmental assessment function of the wheat yield prediction model, and output the environmental score G e ;
[0016] j) Compress the vector V c 、Environmental score G e Input into the yield prediction function of the wheat yield prediction model, and output the predicted yield O yield ;
[0017] k) Calculate the predicted output O through the MSE loss function yieldThe loss of the actual yield E is used to iterate the wheat yield prediction model using the Adam optimizer to obtain the trained wheat yield prediction model;
[0018] l) The wheat remote sensing data P in the test set wheat The environmental data are input into the trained wheat yield prediction model, and the final predicted yield O′ is output. yield .
[0019] Further, step a) comprises the following steps:
[0020] a-1) Use a drone to take images of the winter wheat planting area at weekly intervals to obtain an image set P, where P = [P 1 ,P 2 ,...,P i ,...,P n ], where P i is the image of the winter wheat planting area taken in the i-th week, i∈{1,...,n}, n is the total number of weeks, and the average temperature of the winter wheat planting area is collected every week to form the average temperature set T, T=[T 1 ,T 2 ,...,T i ,...,T n ], T i is the average temperature of the winter wheat planting area in the i-th week, and the average humidity of the winter wheat planting area is collected every week to form the average humidity set H, H = [H 1 ,H 2 ,...,H i ,...,H n ],H i is the average humidity of the winter wheat planting area in the ith week, and the average light intensity of the winter wheat planting area is collected every week to form the average light intensity set L, L = [L 1 ,L 2 ,...,L i ,...,L n ],L i is the average light intensity of the winter wheat planting area in the i-th week, and the image environment data of the i-th week is A i , A i = {P i ,T i ,H i ,L i}, image environment dataset A = [A 1 ,A 2 ,...,A i ,...,A n ];
[0021] a-2) Obtain the actual yield E of the winter wheat planting area during the harvest season.
[0022] Preferably, the image environment dataset A is divided into a training set and a test set in a ratio of 4:1.
[0023] Furthermore, in step c), the image P of the winter wheat planting area taken in the i-th week in the training set is i Input into the digital elevation model DEM, and output the wheat remote sensing data P wheat .
[0024] Further, step e) comprises the following steps:
[0025] e-1) The first feature extractor of the wheat yield prediction model is composed of the first convolution layer, the first ReLU activation function, the average pooling layer, the second convolution layer, the second ReLU activation function, the first maximum pooling layer, the third convolution layer, the third ReLU activation function, and the second maximum pooling layer in sequence;
[0026] e-2) The wheat remote sensing data P wheat Input into the first feature extractor, and output the first remote sensing feature F rs-1 .
[0027] Further, step f) comprises the following steps:
[0028] f-1) The color sensor of the wheat yield prediction model consists of an HSV conversion layer, a feature fusion layer, a convolution layer, a ReLU activation function, and an average pooling layer;
[0029] f-2) Convert wheat remote sensing data P in RGB format wheat Input to the HSV conversion layer of the color sensor, wheat remote sensing data P wheat The pixel value R of the red component of the j-th pixel j The range is [0,255], the wheat remote sensing data P wheat The pixel value G of the green component of the jth pixel j The range is [0,255], the wheat remote sensing data P wheat The pixel value B of the blue component of the j-th pixel j The range is [0,255], j∈{1,...,m}, m is the wheat remote sensing data P wheat The total number of pixels in the Calculate the pixel value R' of the red component of the jth pixel after standardization j , through the formula Calculate the pixel value G′ of the green component of the jth pixel after standardization j , through the formula Calculate the pixel value B′ of the blue component of the jth pixel after standardization j ;
[0030] f-3) Through formula C max =max(R′ j ,G′ j ,B′ j ) Calculate the maximum value C max , through formula C min =min(R′ j ,G′ j ,B′ j ) Calculate the minimum value C min ;
[0031] f-4) Through the formula V j =C max Calculate the brightness value V of the jth pixel j , when the maximum value C max When it is equal to 0, the saturation S of the jth pixel j Equal to 0, when the maximum value C max When it is not equal to 0, the formula Calculate the saturation S of the jth pixel j ;
[0032] f-5) Through the formula Calculate the hue value H of the jth pixel j , wheat remote sensing data P wheat The H value H after the j-th pixel point completes the HSV conversion j 、S value is S j 、V value is V j , and obtain the wheat remote sensing data P after HSV format conversion w ' heat ;
[0033] f-6) Wheat remote sensing data P w ' heat With the first remote sensing feature F rs-1 Input to the feature fusion layer of the color sensor for addition operation to obtain the feature map F P ;
[0034] f-7) The feature map F P It is input into the convolution layer, ReLU activation function, and average pooling layer of the color sensor in sequence, and the color perception feature F is output. c .
[0035] Further, step g) comprises the following steps:
[0036] g-1) The second feature extractor of the wheat yield prediction model is composed of a first convolutional layer, a first ReLU activation function, a first maximum pooling layer, a second convolutional layer, a second ReLU activation function, and a second maximum pooling layer in sequence;
[0037] g-2) The color perception feature F c Input into the second feature extractor, and output the second perceptual feature F rs-2 .
[0038] Further, step h) comprises the following steps:
[0039] h-1) The feature compressor of the wheat yield prediction model consists of a feature stretching layer, a first fully connected layer, a second fully connected layer, and a third fully connected layer;
[0040] h-2) The second perceptual feature F rs-2 Input to the feature stretching layer of the feature compressor, and use the view function in the Pytorch library to convert the second perception feature F rs-2 Flatten it into a one-dimensional vector along the channel direction, and input the one-dimensional vector into the first fully connected layer, the second fully connected layer, and the third fully connected layer of the feature compressor in sequence, and the compressed vector V is output. c , V c =[V 1 ,V 2 ,...,V p ,...,V O ], where V p is the element output by the pth neuron of the third fully connected layer, p∈{1,...,O}, O is the total number of neurons in the third fully connected layer. Further, step i) comprises the following steps:
[0041] i-1) The average temperature T of the winter wheat planting area in the i-th week of the training set i , the average humidity H in the winter wheat planting area in week i i , the average light intensity L in the winter wheat planting area in week i i Input into the environmental assessment function of the wheat yield prediction model, through the formula Calculate the temperature weight W T , through the formula Calculate the humidity weight W H , through the formula Calculate the light intensity weight W L ;
[0042] i-2) Through the formula Calculate the temperature contribution value C T , through the formula Calculate the temperature contribution value CH , through the formula Calculate the light intensity contribution value C L ;
[0043] i-3) Through formula G e =max(0,min(100,C T +C H +C L )) Calculate the environmental score G e .
[0044] Further, step j) comprises the following steps:
[0045] j-1) Compressed vector V c 、Environmental score G e Input into the yield prediction function of the wheat yield prediction model through the formula Calculate the predicted output O yield , where V q is the output element of the qth neuron in the third fully connected layer, q∈{1,...,O}, w p is the weight, c q is the coefficient, f is a nonlinear function, f = sin(2.3·V q ), k is the adjustment coefficient, k = 0.218, T wheat is the week number of the i-th week.
[0046] The beneficial effect of the present invention is that after the wheat remote sensing data to be tested is preprocessed, combined with the current environmental parameters and growth time information, it is input into the trained wheat yield prediction model to achieve accurate prediction of future wheat yield. The method of the present invention combines remote sensing data and environmental factors and uses deep learning technology to not only improve the prediction accuracy of wheat yield, but also provide a scientific basis for agricultural production decision-making, and has significant economic value and good application prospects. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 The present invention is a flow chart of the method. DETAILED DESCRIPTION
[0048] The following is combined with Figure 1 The present invention is further described.
[0049] A wheat yield prediction method based on machine learning comprises the following steps:
[0050] a) Construct the Y-wheat dataset, which consists of the image environment dataset A and the actual yield E.
[0051] b) Divide the image environment dataset A into a training set and a test set.
[0052] c) Preprocess the images in the training set to obtain wheat remote sensing data P wheat .
[0053] d) Constructing a wheat yield prediction model consisting of a first feature extractor, a color sensor, a second feature extractor, a feature compressor, an environmental assessment function, and a yield prediction function.
[0054] e) The wheat remote sensing data P wheat Input into the first feature extractor of the wheat yield prediction model, and output the first remote sensing feature F rs-1 .
[0055] f) The wheat remote sensing data P wheat and the first remote sensing feature F rs-1 Input into the color sensor of the wheat yield prediction model, and output the color perception feature F c .
[0056] g) The color perception feature F c Input into the second feature extractor of the wheat yield prediction model, and output the second perceptual feature F rs-2 .
[0057] h) The second perceptual feature F rs-2 Input into the feature compressor of the wheat yield prediction model, and output the compressed vector V c .
[0058] i) Input the environmental data in the training set into the environmental assessment function of the wheat yield prediction model, and output the environmental score G e .
[0059] j) Compress the vector V c 、Environmental score G e Input into the yield prediction function of the wheat yield prediction model, and output the predicted yield O yield .
[0060] k) Calculate the predicted output O through the MSE loss function yield The loss of the actual yield E is used, and the Adam optimizer is used to iterate the wheat yield prediction model using the loss to obtain the trained wheat yield prediction model.
[0061] l) The wheat remote sensing data P in the test set wheat The environmental data are input into the trained wheat yield prediction model, and the final predicted yield O′ is output. yield .
[0062] First, images, environmental parameters, growth time and actual yield information of winter wheat planting areas are collected to construct a data set named Y-wheat. Next, the wheat remote sensing images in the training set are corrected by digital elevation model (DEM) to achieve orthorectification, thereby obtaining high-quality wheat remote sensing data. Subsequently, the corrected remote sensing data is input into the first feature extractor to extract preliminary remote sensing features, and these features are combined with the original remote sensing data and further input into the color sensor to extract color perception features. Next, the color perception features are sent to the second feature extractor to generate second perception features, which are then input into the feature compressor to obtain an optimized compression vector. At the same time, environmental parameters such as average temperature, average humidity and average light intensity are input into the environmental assessment function to calculate the environmental score. The next step is to input the compression vector, environmental score and corresponding growth time into the yield prediction function together to output the predicted yield of wheat. During the model training process, the mean square error (MSE) loss function is used to calculate the loss between the predicted yield and the actual yield, and the parameters of the wheat yield prediction model are iteratively adjusted through the Adam optimizer to obtain the best training model and improve the prediction accuracy of wheat yield.
[0063] In one embodiment of the present invention, step a) comprises the following steps:
[0064] a-1) Use an unmanned aerial vehicle (UAV) to take images of the winter wheat planting area at weekly intervals to obtain an image set P, where P = [P 1 ,P 2 ,...,P i ,...,P n ], where P i is the image of the winter wheat planting area taken in the i-th week, i∈{1,...,n}, n is the total number of weeks, and the average temperature of the winter wheat planting area is collected every week to form the average temperature set T, T=[T 1 ,T 2 ,...,T i ,...,T n ], T i is the average temperature of the winter wheat planting area in the i-th week, and the average humidity of the winter wheat planting area is collected every week to form the average humidity set H, H = [H 1 ,H 2 ,...,H i ,...,H n ],H i is the average humidity of the winter wheat planting area in the ith week, and the average light intensity of the winter wheat planting area is collected every week to form the average light intensity set L, L = [L 1 ,L 2 ,...,L i ,...,L n ],Li is the average light intensity of the winter wheat planting area in the i-th week, and the image environment data of the i-th week is A i , A i = {P i ,T i ,H i ,L i}, image environment dataset A = [A 1 ,A 2 ,...,A i ,...,A n ].
[0065] a-2) Obtain the actual yield E (in kg / mu) of the winter wheat planting area during the harvest season.
[0066] In one embodiment of the present invention, the image environment dataset A is divided into a training set and a test set in a ratio of 4:1.
[0067] In one embodiment of the present invention, in step c), the image P of the winter wheat planting area captured in the i-th week in the training set is i Input into the digital elevation model DEM, and output the wheat remote sensing data P wheat .
[0068] In one embodiment of the present invention, step e) comprises the following steps:
[0069] e-1) The first feature extractor of the wheat yield prediction model consists of the first convolutional layer, the first ReLU activation function, the average pooling layer, the second convolutional layer, the second ReLU activation function, the first maximum pooling layer, the third convolutional layer, the third ReLU activation function, and the second maximum pooling layer.
[0070] e-2) The wheat remote sensing data P wheat Input into the first feature extractor, and output the first remote sensing feature F rs-1 .
[0071] In this embodiment, preferably, the convolution kernel size of the first convolution layer of the first feature extractor is 3×3, the number of convolution kernels is 32, the stride is 1, and 'same' padding is used; the pooling window size of the average pooling layer of the first feature extractor is 1×1, and the stride is 1; the convolution kernel size of the second convolution layer of the first feature extractor is 3×3, the number of convolution kernels is 128, the stride is 1, and 'same' padding is used; the pooling window size of the first maximum pooling layer of the first feature extractor is 2×2, and the stride is 1; the convolution kernel size of the third convolution layer of the first feature extractor is 7×7, the number of convolution kernels is 512, the stride is 3, and 'same' padding is used; the pooling window size of the second maximum pooling layer of the first feature extractor is 3×3, and the stride is 1.
[0072] In one embodiment of the present invention, step f) comprises the following steps:
[0073] f-1) The color sensor of the wheat yield prediction model consists of an HSV conversion layer, a feature fusion layer, a convolution layer, a ReLU activation function, and an average pooling layer.
[0074] f-2) Convert wheat remote sensing data P in RGB format wheat Input to the HSV conversion layer of the color sensor, wheat remote sensing data P wheat The pixel value R of the red component of the j-th pixel j The range is [0,255], the wheat remote sensing data P wheat The pixel value G of the green component of the jth pixel j The range is [0,255], the wheat remote sensing data P wheat The pixel value B of the blue component of the j-th pixel j The range is [0,255], j∈{1,...,m}, m is the wheat remote sensing data P wheat The total number of pixels in the Calculate the pixel value R' of the red component of the jth pixel after standardization j , through the formula Calculate the pixel value G′ of the green component of the jth pixel after standardization j , through the formula Calculate the pixel value B′ of the blue component of the jth pixel after standardization j .
[0075] f-3) Through formula C max =max(R′ j ,G′ j ,B′ j ) Calculate the maximum value C max , through formula C min =min(R′ j ,G′ j ,B′ j ) Calculate the minimum value C min .
[0076] f-4) Through the formula V j =C max Calculate the brightness value V of the jth pixel j , when the maximum value C max When it is equal to 0, the saturation S of the jth pixel j Equal to 0, when the maximum value C max When it is not equal to 0, the formula Calculate the saturation S of the jth pixel j .
[0077] f-5) Through the formula Calculate the hue value H of the jth pixel j , wheat remote sensing data P wheat The H value H after the j-th pixel point completes the HSV conversion j 、S value is S j 、V value is V j , and obtain the wheat remote sensing data P after HSV format conversion w ' heat .
[0078] f-6) Wheat remote sensing data P w ' heat With the first remote sensing feature F rs-1 Input to the feature fusion layer of the color sensor for addition operation to obtain the feature map F P .
[0079] f-7) The feature map F P It is input into the convolution layer, ReLU activation function, and average pooling layer of the color sensor in sequence, and the color perception feature F is output. c .
[0080] In this embodiment, the convolution kernel size of the convolution layer of the preferred color sensor is 3×3, the number of convolution kernels is 256, the stride is 1, and 'same' padding is used; the pooling window size of the average pooling layer of the color sensor is 3×3, and the stride is 1.
[0081] In one embodiment of the present invention, step g) comprises the following steps:
[0082] g-1) The second feature extractor of the wheat yield prediction model is composed of the first convolution layer, the first ReLU activation function, the first maximum pooling layer, the second convolution layer, the second ReLU activation function, and the second maximum pooling layer. g-2) The color perception feature F c Input into the second feature extractor, and output the second perceptual feature F rs-2 .
[0083] In this embodiment, preferably, the convolution kernel size of the first convolution layer of the second feature extractor is 3×3, the number of convolution kernels is 512, the stride is 1, and 'same' padding is used; the pooling window size of the first maximum pooling layer of the second feature extractor is 3×3, the stride is 1; the convolution kernel size of the second convolution layer of the second feature extractor is 3×3, the number of convolution kernels is 1024, the stride is 1, and 'same' padding is used; the pooling window size of the second maximum pooling layer of the second feature extractor is 3×3, and the stride is 1.
[0084] Step h) comprises the following steps:
[0085] h-1) The feature compressor of the wheat yield prediction model consists of a feature stretching layer, a first fully connected layer, a second fully connected layer, and a third fully connected layer.
[0086] h-2) The second perceptual feature F rs-2 Input to the feature stretching layer of the feature compressor, and use the view function in the Pytorch library to convert the second perception feature F rs-2 Flatten it into a one-dimensional vector along the channel direction, and input the one-dimensional vector into the first fully connected layer, the second fully connected layer, and the third fully connected layer of the feature compressor in sequence, and the compressed vector V is output. c , V c =[V 1 ,V 2 ,...,V p ,…,V O ], where V p is the element output by the pth neuron of the third fully connected layer, p∈{1,…,O}, and O is the total number of neurons in the third fully connected layer. In this embodiment, the preferred number of neurons in the first fully connected layer is 512, the number of neurons in the second fully connected layer is 128, and the number of neurons in the third fully connected layer is 8, that is, O=8.
[0087] In one embodiment of the present invention, step i) comprises the following steps:
[0088] i-1) The average temperature T of the winter wheat planting area in the i-th week of the training set i , the average humidity H in the winter wheat planting area in week i i , the average light intensity L in the winter wheat planting area in week i i Input into the environmental assessment function of the wheat yield prediction model, and assign corresponding weights to each input according to the different states of environmental factors, so as to reflect the impact under extreme conditions. Define the weighting factor of the environmental assessment function, specifically through the formula Calculate the temperature weight W T , through the formula Calculate the humidity weight W H , through the formula Calculate the light intensity weight W L .
[0089] i-2) Through the formula Calculate the temperature contribution value C T , through the formula Calculate the temperature contribution value C H , through the formula Calculate the light intensity contribution value C L By using an exponential decay function, the score in the working range is smoother, while the score is reduced near the extreme value to reflect the actual situation. The contribution of each factor is calculated according to the weight in step i-1), ensuring that the final score is between 0 and 100, and the minimum and maximum functions are used for processing. exp() represents an exponential function with the natural constant e as the base.
[0090] i-3) Through formula G e =max(0,min(100,C T +C H +C L )) Calculate the environmental score G e .
[0091] In one embodiment of the present invention, step j) comprises the following steps:
[0092] j-1) Compressed vector V c 、Environmental score G e Input into the yield prediction function of the wheat yield prediction model through the formula Calculate the predicted output O yield , where V q is the output element of the qth neuron in the third fully connected layer, q∈{1,…,O}, w p is the weight, c q are coefficients associated with the features in the compressed vector, used to describe the effects of interactions, f is a nonlinear function, which indicates the interaction or nonlinear effect between features. f = sin(2.3·V q ), k is the adjustment coefficient of the effect of generation time on output, k = 0.218, T wheat is the week number of the i-th week.
[0093] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A wheat yield prediction method based on machine learning, characterized in that: The steps include: a) Construct the Y-wheat dataset, which consists of the image environment dataset A and the actual yield E; b) dividing the image environment dataset A into a training set and a test set; c) Preprocess the images in the training set to obtain wheat remote sensing data P wheat ; d) constructing a wheat yield prediction model consisting of a first feature extractor, a color sensor, a second feature extractor, a feature compressor, an environmental assessment function, and a yield prediction function; e) The wheat remote sensing data P wheat Input into the first feature extractor of the wheat yield prediction model, and output the first remote sensing feature F rs-1 ; f) The wheat remote sensing data P wheat and the first remote sensing feature F rs-1 Input into the color sensor of the wheat yield prediction model, and output the color perception feature F c ; g) The color perception feature F c Input into the second feature extractor of the wheat yield prediction model, and output the second perceptual feature F rs-2 ; h) The second perceptual feature F rs-2 Input into the feature compressor of the wheat yield prediction model, and output the compressed vector V c ; i) Input the environmental data in the training set into the environmental assessment function of the wheat yield prediction model, and output the environmental score G e ; j) Compress the vector V c 、Environmental score G e Input into the yield prediction function of the wheat yield prediction model, and output the predicted yield O yield ; k) Calculate the predicted output O through the MSE loss function yield The loss of the actual yield E is used to iterate the wheat yield prediction model using the Adam optimizer to obtain the trained wheat yield prediction model; l) The wheat remote sensing data P in the test set wheat The environmental data are input into the trained wheat yield prediction model, and the final predicted yield is obtained as output. y ' ield .
2. The wheat yield prediction method based on machine learning according to claim 1, characterized in that: Step a) comprises the following steps: a-1) Use a drone to take images of the winter wheat planting area at weekly intervals to obtain an image set P, where P = [P1, P2, …, P i ,…,P n ], where P i is the image of the winter wheat planting area taken in the i-th week, i∈{1,...,n}, n is the total number of weeks, and the average temperature of the winter wheat planting area is collected every week to form an average temperature set T, T=[T1,T2,…,T i ,…,T n ], T i is the average temperature of the winter wheat planting area in the i-th week, and the average humidity of the winter wheat planting area is collected every week to form an average humidity set H, H = [H1, H2, ..., H i ,...,H n ],H i is the average humidity of the winter wheat planting area in the ith week, and the average light intensity of the winter wheat planting area is collected every week to form an average light intensity set L, L = [L1, L2, ..., L i ,...,L n ],L i is the average light intensity of the winter wheat planting area in the i-th week, and the image environment data of the i-th week is A i , A i = {P i ,T i ,H i ,L i }, image environment dataset A = [A1, A2, ..., A i ,...,A n ]; a-2) Obtain the actual yield E of the winter wheat planting area during the harvest season.
3. The wheat yield prediction method based on machine learning according to claim 2, characterized in that: The image environment dataset A is divided into a training set and a test set in a ratio of 4:
1.
4. The wheat yield prediction method based on machine learning according to claim 2, characterized in that: In step c), the image P of the winter wheat planting area taken in the i-th week in the training set is i Input into the digital elevation model DEM, and output the wheat remote sensing data P wheat .
5. The wheat yield prediction method based on machine learning according to claim 1, characterized in that: Step e) comprises the following steps: e-1) The first feature extractor of the wheat yield prediction model is composed of the first convolution layer, the first ReLU activation function, the average pooling layer, the second convolution layer, the second ReLU activation function, the first maximum pooling layer, the third convolution layer, the third ReLU activation function, and the second maximum pooling layer in sequence; e-2) The wheat remote sensing data P wheat Input into the first feature extractor, and output the first remote sensing feature F rs-1 .
6. The wheat yield prediction method based on machine learning according to claim 1, characterized in that: Step f) comprises the following steps: f-1) The color sensor of the wheat yield prediction model consists of an HSV conversion layer, a feature fusion layer, a convolution layer, a ReLU activation function, and an average pooling layer; f-2) Convert wheat remote sensing data P in RGB format wheat Input to the HSV conversion layer of the color sensor, wheat remote sensing data P wheat The pixel value R of the red component of the j-th pixel j The range is [0,255], the wheat remote sensing data P wheat The pixel value G of the green component of the jth pixel j The range is [0,255], the wheat remote sensing data P wheat The pixel value B of the blue component of the j-th pixel j The range is [0,255], j∈{1,...,m}, m is the wheat remote sensing data P wheat The total number of pixels in the Calculate the pixel value R' of the red component of the jth pixel after standardization j , through the formula Calculate the pixel value G′ of the green component of the jth pixel after standardization j , through the formula Calculate the pixel value B′ of the blue component of the jth pixel after standardization j ; f-3) Through formula C max =max(R′ j ,G′ j ,B′ j ) Calculate the maximum value C max , through formula C min =min(R′ j ,G′ j ,B′ j ) Calculate the minimum value C min ; f-4) Through the formula V j =C max Calculate the brightness value V of the jth pixel j , when the maximum value C max When it is equal to 0, the saturation S of the jth pixel j Equal to 0, when the maximum value C max When it is not equal to 0, the formula Calculate the saturation S of the jth pixel j ; f-5) through the formula Calculate the hue value H of the jth pixel j , wheat remote sensing data P wheat The H value H after the j-th pixel point completes the HSV conversion j 、S value is S j 、V value is V j , and obtain the wheat remote sensing data P after HSV format conversion w ' heat ; f-6) Wheat remote sensing data P w ' heat With the first remote sensing feature F rs-1 Input to the feature fusion layer of the color sensor for addition operation to obtain the feature map F P ; f-7) The feature map F P It is input into the convolution layer, ReLU activation function, and average pooling layer of the color sensor in sequence, and the color perception feature F is output. c .
7. The wheat yield prediction method based on machine learning according to claim 1, characterized in that: Step g) comprises the following steps: g-1) The second feature extractor of the wheat yield prediction model is composed of the first convolution layer, the first ReLU activation function, the first maximum pooling layer, the second convolution layer, the second ReLU activation function, and the second maximum pooling layer in sequence; g-2) The color perception feature F c Input into the second feature extractor, and output the second perceptual feature F rs-2 .
8. The wheat yield prediction method based on machine learning according to claim 1, characterized in that: Step h) comprises the following steps: h-1) The feature compressor of the wheat yield prediction model consists of a feature stretching layer, a first fully connected layer, a second fully connected layer, and a third fully connected layer; h-2) The second perceptual feature F rs-2 Input to the feature stretching layer of the feature compressor, and use the view function in the Pytorch library to convert the second perception feature F rs-2 Flatten it into a one-dimensional vector along the channel direction, and input the one-dimensional vector into the first fully connected layer, the second fully connected layer, and the third fully connected layer of the feature compressor in sequence, and the compressed vector V is output. c , V c =[V1,V2,...,V p ,…,V O ], where V p is the element output by the pth neuron in the third fully connected layer, p∈{1,...,O}, and O is the total number of neurons in the third fully connected layer.
9. The wheat yield prediction method based on machine learning according to claim 1, characterized in that: Step i) comprises the following steps: i-1) The average temperature T of the winter wheat planting area in the i-th week of the training set i , the average humidity H in the winter wheat planting area in week i i , the average light intensity L in the winter wheat planting area in week i i Input into the environmental assessment function of the wheat yield prediction model, through the formula Calculate the temperature weight W T , through the formula Calculate the humidity weight W H , through the formula Calculate the light intensity weight W L ; i-2) Through the formula Calculate the temperature contribution value C T , through the formula Calculate the temperature contribution value C H , through the formula Calculate the light intensity contribution value C L ; i-3) Through formula G e =max(0,min(100,C T +C H +C L )) Calculate the environmental score G e .
10. The wheat yield prediction method based on machine learning according to claim 8, characterized in that: Step j) comprises the following steps: j-1) Compressed vector V c 、Environmental score G e Input into the yield prediction function of the wheat yield prediction model through the formula Calculate the predicted output O yield , where V q is the output element of the qth neuron in the third fully connected layer, q∈{1,…,O}, w p is the weight, c q is the coefficient, f is a nonlinear function, f = sin(2.3·V q ), k is the adjustment coefficient, k = 0.218, T wheat is the week number of the i-th week.
Citation Information
Cited By
Parallel CNN-LSTM-Attention wheat yield prediction method based on transfer learning
CN121119234A