Intelligent fertilization method for barley cultivation
By constructing a multi-head attention mechanism barley fertilization prediction model and real-time data collection, the accuracy and cost problems of the intelligent barley fertilization method in the existing technology in coping with changes in the dynamic growth environment are solved, and efficient and intelligent fertilization operations are achieved.
Patent Information
- Application Number
- CN202411044645.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-12-03
AI Technical Summary
The existing intelligent barley fertilization methods are difficult to provide the most accurate fertilization guidance when dealing with dynamic changes in soil, growth environment and climatic conditions, and there is a problem of high labor costs.
A barley fertilization amount prediction model is constructed based on the multi-head attention mechanism, and the fertilizer amount under different growth conditions is predicted through feature screening and sample reinforcement learning strategies, and data is collected in real time by sensors for intelligent fertilization guidance.
It improves the accuracy of fertilization volume prediction, reduces hardware and labor costs, improves the intelligence and generalization capabilities of fertilization operations, and realizes precise fertilization under different growth conditions.
Smart Images

Figure CN119067463A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of smart agriculture, and in particular relates to an intelligent fertilization method for barley cultivation. Background Art
[0002] In the process of barley cultivation, the correct use of fertilizers is a key measure to quickly replenish soil nutrients, increase soil nitrogen content, and optimize the growth environment of barley. It aims to accurately meet the nutritional needs of barley throughout its entire growth cycle, thereby promoting an increase in the amount of fertilizer applied. However, in reality, many barley growers often encounter the dilemma of inaccurate fertilizer application due to their lack of professional agricultural knowledge. This unscientific fertilization method not only fails to stimulate the production potential of barley, but is counterproductive, easily leading to imbalanced growth of barley, increasing the risk of lodging and pests and diseases, and ultimately causing a reduction in production. What is more serious is that this type of improper fertilization has also caused a series of environmental problems: water bodies are polluted due to eutrophication, soil structure is destroyed and loses balance, and the atmosphere may also be polluted due to the volatilization of fertilizers. Therefore, the implementation of reasonable fertilization and scientific fertilization strategies has become a major issue that needs to be urgently addressed in the current agricultural production field.
[0003] The existing intelligent fertilization methods for barley mainly include the following two types: a database-based intelligent fertilization method and a cloud network-based intelligent fertilization method.
[0004] Database-based intelligent fertilization method: The database-based intelligent fertilization method is a precision fertilization method that combines modern information technology and agricultural science. This method builds a database containing multi-dimensional data such as soil nutrients, crop growth data, climate and environmental information, and provides fertilization suggestions to barley growers based on the data provided by the agricultural database. Specifically, this fertilization method analyzes factors such as soil nutrient status, crop growth requirements, and meteorological conditions, and refers to past historical data in the database to provide barley growers with fertilization times at different growth stages of barley.
[0005] Smart fertilization method based on cloud network: Smart fertilization method based on cloud network is a modern agricultural technology that integrates data collection, cloud analysis and expert decision-making. It monitors farmland environmental data in real time and uses the cloud network platform to send real-time growth data of barley, soil condition data and climate condition data to barley planting experts to generate barley fertilization suggestions, and ultimately guide barley growers to accurately fertilize, so as to achieve efficient use of resources and improve the amount and quality of barley fertilizer.
[0006] Regarding the intelligent fertilization methods in barley planting, these methods deploy sensors to collect soil condition data, barley growth data and related climate data during barley growth. And use these collected data to guide intelligent fertilization by referring to the database method or by remote expert control. However, in actual barley planting, soil conditions, barley growth conditions and climate conditions are in a dynamic process of change. The method of referring to the database cannot give the most accurate fertilization method guidance based on the real-time barley growth conditions. The cloud network method will bring huge manpower costs when dealing with the problem of real-time changes in barley growth conditions and growth environment. In general, the existing barley intelligent fertilization technology still has defects in dealing with the problem of real-time changes in the growth environment and growth conditions. These problems need to be further addressed to improve the efficiency of fertilization during barley growth. Summary of the invention
[0007] In view of the above problems, the first aspect of the present invention proposes a method for constructing an intelligent fertilization model for barley cultivation, comprising the following steps:
[0008] Step 1: Based on several groups of barley planting record data with yield and fertilizer application ratios that meet the requirements, an initial data set is constructed using m feature data that affect the final barley fertilizer application amount; wherein, the feature data recorded for each day are spliced together to obtain the spliced feature data d for one day, and the data d recorded for t days is used as the input information d* for the fertilizer application amount prediction, and the total barley fertilizer application amount O corresponding to the next week is used as the output;
[0009] Step 2, feature screening is performed based on mutual information and correlation coefficient, n features with the highest correlation with the amount of fertilizer applied to barley are selected, and these features are used as input features to construct a standard data set;
[0010] Step 3, constructing a barley fertilizer application prediction model based on a multi-head attention mechanism to predict the total fertilizer application amount of barley within a week corresponding to the barley growth period and different growth conditions;
[0011] Step 4: Based on the standard data set in step 2 and a model training strategy based on sample reinforcement, the barley fertilizer application prediction model is trained to find the model parameters that optimize the model prediction performance and obtain the final intelligent fertilization model.
[0012] Preferably, the m features in step 1 include eight features, namely, an average barley stalk height ZS during barley planting, a temperature ZT of the growing environment, a humidity ZM of the growing environment, a soil caking condition TJ, a soil nitrogen content TF, a soil moisture condition TM, a sunshine intensity condition S, and a carbon dioxide condition C in the air; and the recorded feature data of each day are spliced together to obtain spliced feature data of one day d=[ZS, ZT, ZM, TJ, TF, TM, S, C];
[0013] Concatenate feature data vector d * and the amount of barley fertilizer O, we get a set of data d - , l group data d - Combine them together to get the initial data set;
[0014] The normalization operation function is used to normalize the initial data set to obtain the normalized data D.
[0015] Preferably, the specific process of step 2 is:
[0016] S21, correlation coefficient calculation: Calculate the correlation coefficient K of the m characteristics during the barley planting period and the total amount of barley fertilizer O in sequence j , j∈[1,m];
[0017]
[0018] Among them, X j Represents each feature data in turn, K j Indicates the correlation coefficient corresponding to each feature, COV(*) indicates the cross-correlation function, and VAR(*) indicates the variance solution function;
[0019] S22, mutual information value calculation: sequentially calculate the mutual information value R of the m features during the barley planting period and the total amount of barley fertilizer O j , j∈[1,m];
[0020] R j =H(X j )+H(O)-HX(X j , O)
[0021] Among them, X j In turn, each feature data is represented, H(*) represents the information entropy solution function, and HX(*, *) represents the mutual information entropy solution function;
[0022] S23, feature coefficient solution: The mutual information value R of each feature calculated based on S21 and S22 j And the correlation coefficient K of each feature j , R jCan find feature X from the perspective of information entropy j Correlation between barley fertilizer application rate O, K j Find feature X from the perspective of cross-correlation j The correlation between the fertilizer application amount O and barley is the mutual information value R j Assign a weight of 0.7 for the correlation coefficient K j Assign a weight of 0.3, and then perform weighted summation to obtain the feature coefficient B of each feature. j ;
[0023] B j =0.3K j +0.7R j
[0024] S24, based on the characteristic coefficient of each feature obtained by solving the process of S23, the larger the characteristic coefficient is, the higher the correlation with the amount of fertilizer applied is. The five features with the highest characteristic coefficients are selected to construct a standard data set.
[0025] Preferably, the barley fertilizer amount prediction model based on the multi-head attention mechanism uses n groups of encoder modules corresponding to n features respectively. In order to enhance the ability of information extraction, each encoder module includes 6 encoders connected in sequence to perform deep extraction processing on the input features, and then the outputs of the n groups of encoder modules are fused using the multi-head attention mechanism module, and finally output through a fully connected layer and a softmax activation function.
[0026] Preferably, the encoder is specifically:
[0027] In the encoder structure, for each input encoder feature X i , this feature first passes through an embedding layer to extract the feature information vector Emb of each feature i :
[0028] Emb i =Embding(X i )
[0029] Among them, Embedding(*) represents the embedding layer operation function, Emb i Represents feature X i Feature information vector after being processed by the embedding layer;
[0030] Then enter the self-attention mechanism module to perform feature calculation: the feature information vector Emb i It is sent to three fully connected layers (Q, W, L) for further processing, and features are extracted from multiple dimensions to obtain feature information Q in three different dimensions i , W i , V i :
[0031] Q i =QLJ(Emb i )
[0032] W i =WLJ(Emb i )
[0033] V i =VLJ(Emb i )
[0034] Among them, QLJ, WLJ, VLJ represent the layer operation functions of the fully connected layers Q, W, and L respectively, and then the feature information Q i , W i , V i After a linear layer and an activation function softmax, the fused feature information Z is obtained. i ;
[0035] Z i =softmax(line(Q i , W i , V i ))
[0036] Among them, line(*) represents the linear layer processing function.
[0037] Preferably, the multi-head attention mechanism module is specifically:
[0038] The output of the last encoder in the encoder module is defined as
[0039]
[0040] Among them, i∈[1,n], Encoder(*) represents the encoder module operation function. Since there are n different features, a multi-head attention mechanism is then used to analyze these n different features. Perform weighted processing to obtain feature cross-fusion information Z;
[0041]
[0042] Among them, ATT(*) represents the attention mechanism module operation function.
[0043] Preferably, the model training strategy based on sample enhancement in step 4 is specifically:
[0044] The loss function L for the barley fertilizer application model was designed based on the mean square error loss function. C :
[0045]
[0046] Among them, Z represents the amount of fertilizer for barley predicted by the model in a single prediction;
[0047] The specific process includes:
[0048] S41, initialize the training weight of each group of data in the data set, where the total number of data samples is M, so the training weight of each sample is V w Set to:
[0049]
[0050] Among them, w∈[1,M], and the initial parameter in this barley fertilizer application prediction model is set to C0;
[0051] S42, perform iterative model training and calculate the loss function result of the current iteration:
[0052] L w =V w *L C
[0053]
[0054] Among them, L C is the loss result obtained by training the w-th sample, L w represents the loss result after weighting, LOSS1 represents the overall loss after the first iteration, and then the Adam optimizer is used to optimize the parameters based on LOSS1 to obtain the parameter values C1 of the barley fertilizer application prediction model after the first training;
[0055] S43, update the weight of each group of training samples:
[0056]
[0057] Among them, q represents the update weight, and its value is 0.6. represents the updated weight of the w-th sample;
[0058] S44, repeat iterating S42 and S43 to the maximum number of iterations, the maximum number of iterations is set to TL and the overall loss LOSS of each iteration is obtained respectively x , x∈[1,TL], and the corresponding parameter q of the barley fertilizer application prediction model x , the model parameters corresponding to the minimum overall loss value are selected as the parameters of the final intelligent fertilization model.
[0059] The second aspect of the present invention provides an intelligent fertilization method suitable for barley cultivation, which deploys the intelligent fertilization model constructed by the construction method described in the first aspect to guide the fertilization operation of barley growers in the next week, and includes the following process:
[0060] Based on the n sets of features during model building, use the corresponding sensors to obtain real-time data;
[0061] Input the acquired characteristic data into the trained intelligent fertilization model;
[0062] Output the predicted fertilizer application amount for the next week as a reference for the actual fertilizer application operation.
[0063] The third aspect of the present invention provides an intelligent fertilization device suitable for barley cultivation, the device comprising at least one processor and at least one memory, the processor and the memory being coupled; the memory stores a computer execution program of the intelligent fertilization model constructed by the construction method described in the first aspect; when the processor executes the computer execution program stored in the memory, the processor executes an intelligent fertilization method suitable for barley cultivation.
[0064] The fourth aspect of the present invention provides a computer-readable storage medium, which stores a computer execution program of the intelligent fertilization model constructed by the construction method described in the first aspect. When the computer execution program is executed by a processor, the processor executes an intelligent fertilization method suitable for barley cultivation.
[0065] Compared with the prior art, the present invention has the following beneficial effects:
[0066] (1) Improve the accuracy of barley fertilizer application prediction: A barley fertilizer application prediction model based on a multi-head attention mechanism was constructed, and a feature extraction module based on the attention mechanism was designed in the barley fertilizer application prediction model, which can perform deep feature extraction and reasonable feature fusion to improve the model prediction accuracy;
[0067] (2) Reduce hardware costs: This method constructs a feature screening module to select features that are highly correlated with the amount of fertilizer applied to barley, thereby reducing the hardware costs. In addition, after the model is trained, no human supervision is required, which further reduces the human cost.
[0068] (3) Strong generalization ability: Using sample reinforcement learning strategy, we can make full use of sample data in the model training stage to optimize the various parameters in the barley fertilizer application prediction model and improve the generalization ability of the system;
[0069] (4) Improving the intelligence of fertilization operation: The barley fertilizer application prediction model is actually deployed in barley production fields, and various sensors are used to collect land and growth data during the barley growth period in real time. These data are input into the barley fertilizer application prediction model to predict the amount of fertilizer to be used in the fertilization operation. Based on the fertilizer application prediction results, barley growers can achieve intelligent fertilization. BRIEF DESCRIPTION OF THE DRAWINGS
[0070] In order to more clearly illustrate the technical solutions of the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, what is described below is only one embodiment of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0071] Figure 1 The overall process logic block diagram of the intelligent fertilization method for barley cultivation of the present invention;
[0072] Figure 2 It is a structural block diagram of the barley fertilizer application amount prediction model of the present invention;
[0073] Figure 3 It is a schematic diagram of the structure of the encoder of the present invention;
[0074] Figure 4 A logical schematic diagram for deploying and using the intelligent fertilization model of the present invention.
[0075] Figure 5 This is a comparison result diagram of the barley fertilizer amount prediction method based on MSE in Example 1.
[0076] Figure 6 This is a comparison result diagram of the barley fertilizer amount prediction method based on MAPE in Example 1. DETAILED DESCRIPTION
[0077] Embodiment 1:
[0078] The present invention constructs an initial data set through a parallel strategy, namely: collecting historical barley planting and fertilization experiment records, and conducting barley field planting experiments to collect the latest data. Subsequently, a feature screening module based on mutual information and correlation coefficients is constructed to select features that are highly correlated with barley fertilizer application amounts. On this basis, the present invention designs a fertilizer application amount prediction model that integrates a multi-head attention mechanism, aiming to accurately predict the most suitable fertilizer application amount under different soil conditions and barley growth conditions. In addition, in order to improve the prediction accuracy of the model, the present invention adopts a training strategy based on sample reinforcement to optimize the parameters of the barley fertilizer application amount prediction model. Finally, the model was successfully deployed in an actual barley planting environment, providing barley growers with the optimal fertilizer application amount corresponding to different barley growth conditions and different soil conditions. The overall technical route process of the present invention is as follows Figure 1 shown.
[0079] The invention will be further described below in conjunction with specific embodiments.
[0080] 1. Initial dataset construction
[0081] When constructing the initial data set, the present invention fully considers all the features that affect the final barley fertilizer application amount, thereby avoiding missing features that are highly correlated with the barley fertilizer application amount. Therefore, the initial complete features selected in this embodiment include: the average barley stalk height during barley planting (sampling measurement) ZS, the temperature of the growing environment ZT, the humidity of the growing environment ZM, the soil caking situation TJ, the soil nitrogen content TF, the soil humidity TM, the sunshine intensity S, and the carbon dioxide situation C in the air, a total of eight features.
[0082] (1) Based on the existing barley planting record data, select the excellent data with high final barley yield and relatively low fertilizer application to integrate and construct the initial data set D1. The specific construction method of data set D1 is as follows:
[0083] The characteristic data described are obtained from the barley planting record data, and the characteristic data are recorded in days. The characteristic data recorded for each day are spliced together to obtain the spliced characteristic data of the day d = [ZS, ZT, ZM, TJ, TF, TM, S, C].
[0084] In actual model prediction, if the amount of data is too small, the accuracy of the model prediction cannot be guaranteed. Therefore, in this embodiment, the recording time range of the spliced feature data d is set to 10 days. The feature data recorded for 10 days is used as the input information d for the fertilizer application amount prediction. * =[d1, d2, ..., d 10 At the same time, the total amount of fertilizer applied to barley in the next week is recorded and used as the output. * , and the barley fertilizer application amount O, we get a set of data d - .
[0085] d - =[d * , O]
[0086] In the barley planting historical data, the above iterative process is repeated in the historical data that meets the requirements to obtain l sets of data d - . And the l group of data d generated in the process - Combined together, we get the complete initial data set D1;
[0087]
[0088] in, Indicates the lth group d constructed during the data construction process - .
[0089] (2) In order to further enrich the amount of data and improve the learning effect of the subsequent model, this embodiment not only obtains the above data based on the historical data of barley planting, but also obtains the above data by actually planting barley in the barley experimental field. In the barley experimental field, multiple barley planting plots are set, and different parameters are set in different barley planting plots (that is, different plots have different soil nitrogen content conditions, soil moisture conditions, soil caking conditions, and temperature and humidity conditions, light and carbon dioxide conditions of the growth environment during the barley planting period);
[0090] Based on the deployment of barley planting plots, ultrasonic sensors are deployed during the barley planting period to record the average barley stalk height (sampling measurement) ZS every day during the barley planting period in real time, temperature sensors are deployed to record the temperature ZT of the barley growing environment, humidity sensors are deployed to record the humidity ZM of the barley growing environment, soil hardness meters are deployed to record the caking of barley planting soil TJ, soil nutrient rapid testers are deployed to record the soil nitrogen content TF, humidity sensors are deployed to record the soil humidity TM, light intensity sensors are deployed to record the sunshine intensity S, and carbon dioxide sensors are deployed to record the carbon dioxide in the air C in real time. Combined with the fertilizer application recorded during the barley planting process, the dataset is constructed in the same way as dataset D1 to obtain dataset D2.
[0091] (3) Mix the obtained data set D1 and the obtained data set D2 to finally obtain a complete data set D0;
[0092] D0=[D1,D2]
[0093] Since the data set D0 contains multiple types of data, in order to eliminate the dimensional effects existing in different types of data and enhance the learning efficiency and prediction accuracy of the subsequent model, the present invention adopts a normalization operation function to normalize the data set D0 to obtain the normalized data D.
[0094] D=Norm(D0)
[0095] Wherein, Norm(*) represents the normalization operation function.
[0096] 2. Feature Screening
[0097] In the initial data set construction, when considering the features that affect the amount of barley fertilizer, in order not to miss the features with a high correlation with the amount of barley fertilizer, the present invention takes all relevant features into account. However, in actual barley growth, there are some features that have a low correlation with the amount of barley fertilizer. In order to facilitate subsequent model training and reduce model complexity, and when the model is actually deployed to implement barley yield prediction, selecting features with high correlation directly saves hardware costs. Therefore, the present invention proposes a feature screening module based on mutual information and correlation coefficient to determine the key characteristic factors that affect the amount of barley fertilizer. Specifically comprising the following steps:
[0098] S21, correlation coefficient calculation: sequentially calculate the correlation coefficient Kj, j∈[1,8] of the average barley stem height (sampling measurement) ZS during the barley planting period, the temperature ZT of the growing environment, the humidity ZM of the growing environment, the soil caking situation TJ, the soil nitrogen content TF, the soil moisture situation TM, the sunshine intensity situation S, the carbon dioxide situation C in the air and the barley fertilizer application amount data O;
[0099]
[0100] Among them, X j represents each feature in the feature set [ZS, ZT, ZM, TJ, TF, TM, S, C] in turn, K j represents the correlation coefficient corresponding to each feature, O represents the barley fertilizer application data, COV(*) represents the cross-correlation function, and VAR(*) represents the variance solution function;
[0101] S22, mutual information value calculation: sequentially calculate the mutual information value Rj, j∈[1,8] of the average barley stem height (sampling measurement) ZS during the barley planting period, the temperature ZT of the growing environment, the humidity ZM of the growing environment, the soil caking situation TJ, the soil nitrogen content TF, the soil moisture situation TM, the sunshine intensity situation S, the carbon dioxide situation C in the air and the barley fertilizer application amount data O;
[0102] R j =H(X j )+H(O)-HX(X j , O)
[0103] Among them, X j represents each feature in the feature set [ZS, ZT, ZM, TJ, TF, TM, S, C] in turn, O represents the barley fertilizer application data, H(*) represents the information entropy solution function, and HX(*, *) represents the mutual information entropy solution function;
[0104] S23, feature coefficient solution: The mutual information value R of each feature calculated based on S21 and S22j And the correlation coefficient K of each feature j , R j Can find feature X from the perspective of information entropy j Correlation between barley fertilizer application rate O, K j Find feature X from the perspective of cross-correlation j and the correlation between the amount of fertilizer applied to barley O. In the present invention, the mutual information value R j Assign a weight of 0.7 for the correlation coefficient K j Assign a weight of 0.3. Then, weighted sum is performed to obtain the feature coefficient B of each feature. j ;
[0105] B j =0.3K j +0.7R j
[0106] S24, based on the characteristic coefficient of each feature obtained by the process of S23, the larger the characteristic coefficient is, the higher the correlation with the amount of fertilizer applied is. Since the high correlation features of more than 60% of the total features are selected, the prediction accuracy of the model is less affected, and 8*60%≈5. Therefore, in the present invention, the five features with the highest characteristic coefficients are selected, namely M1, M2, M3, M4, and M5.
[0107] S26, based on the feature screening results described in S24, construct a standard data set using the screened high-correlation features.
[0108] 3. Construction of intelligent fertilization model
[0109] The overall structure of the model is as follows Figure 2 As shown, in this embodiment, since only 5 important features are left after feature screening during the feature screening process, 5 groups of encoder modules are selected to correspond to 5 features respectively in the barley fertilizer application prediction model. In order to enhance the ability of information extraction, each encoder module includes 6 encoders connected in sequence to perform deep extraction processing on the input features. Then, the outputs of the 5 groups of encoder modules are fused using a multi-head attention mechanism module, and finally, a fully connected layer and a softmax activation function are used to complete the construction of the entire barley fertilizer application prediction model.
[0110] (1) Encoder structure design
[0111] Encoder structure design: The encoder structure is as follows Figure 3 As shown. In the encoder structure, for each input encoder feature X i , i∈[1,5],X i ∈[M1, M2, M3, M4, M5]. This feature first passes through an embedding layer to further extract the feature information vector Emb of each featurei .
[0112] Emb i =Embding(X i )
[0113] Among them, Embedding(*) represents the embedding layer operation function, Emb i Represents feature X i The feature information vector after being processed by the embedding layer. Feature calculation based on the self-attention mechanism: This feature vector is then Embedded i The model structure design of multiple fully connected layers can extract features from multiple dimensions to obtain feature information Q in three different dimensions. i , W i , V i .
[0114] Q i =QLJ(Emb i )
[0115] W i =WLJ(Emb i )
[0116] V i =VLJ(Emb i )
[0117] Among them, QLJ, WLJ, and VLJ represent the layer operation functions of the fully connected layers Q, W, and L respectively. Then the feature information Q i , W i , V i After a linear layer and an activation function softmax, the fused feature information Z is obtained. i ;
[0118] Z i =softmax(line(Q i , W i , V i ))
[0119] Among them, line(*) represents the linear layer processing function.
[0120] Multi-head attention module construction: In this embodiment, based on the 5 features after feature screening and after encoder processing, a total of 6 encoders arranged in sequence are used in the entire barley fertilizer application prediction model. The output of the last encoder is defined as
[0121]
[0122] Where i∈[1,5], Encoder(*) represents the encoder module operation function. Since there are 5 different features, a multi-head attention mechanism is then used to analyze these 5 different features. Perform weighted processing to obtain feature cross-fusion information Z;
[0123]
[0124] Among them, ATT(*) represents the attention mechanism module operation function.
[0125] 4. Model Training
[0126] The present invention designs a loss function L for the barley fertilizer application model based on the mean square error loss function. C :
[0127]
[0128] Among them, Z represents the amount of barley fertilizer predicted by the model in a single prediction, and O represents the actual amount of barley fertilizer corresponding to the data value in the data set;
[0129] Based on the obtained standard data set and the constructed barley fertilizer application prediction model, the model training is carried out in combination with the sample enhancement training mechanism, and the model parameters of each iterative training are integrated to obtain the final barley fertilizer application prediction model; the specific process is as follows:
[0130] S41, initialize the training weight of each group of data in the data set, where the total number of data samples is M, so the training weight of each sample is V w Set to:
[0131]
[0132] Among them, w∈[1,M], and the initial parameter in this barley fertilizer application prediction model is set to C0;
[0133] S42, perform iterative model training and calculate the loss function result of the current iteration:
[0134] L w =V w *L C
[0135]
[0136] Among them, L C is the loss result obtained by training the w-th sample, L wrepresents the loss result after weighting, LOSS1 represents the overall loss after the first iteration, and then the Adam optimizer is used to optimize the parameters based on LOSS1 to obtain the parameter values C1 of the barley fertilizer application prediction model after the first training;
[0137] S43, update the weight of each group of training samples:
[0138]
[0139] Among them, q represents the update weight, and its value is 0.6. represents the updated weight of the w-th sample;
[0140] S44, repeating steps S42 and S43 to the maximum number of iterations, wherein the maximum number of iterations is set to TL and the overall loss LOSS of each iteration is obtained respectively x , x∈[1,TL], and the corresponding parameter q of the barley fertilizer application prediction model x Since the larger the loss function value is, the worse the prediction effect of the model is, the present invention selects the model parameters corresponding to the minimum overall loss value as the parameters of the final barley fertilizer application amount prediction model.
[0141] 5. Model deployment and application
[0142] The actual deployment flow chart of the barley fertilizer application prediction model is as follows: Figure 4 As shown: Based on the designed barley fertilizer application prediction model and the designed model training strategy, the barley fertilizer application prediction model is finally trained, and the model is used to provide real-time fertilizer application prediction for barley growers to guide barley growers to perform intelligent fertilization operations. The specific implementation steps include:
[0143] Deploy sensors in the barley fields to collect data; according to the above feature screening results, when the model is actually deployed, sensors corresponding to the five most relevant features M1, M2, M3, M4, and M5 obtained after feature screening are deployed to collect data;
[0144] Deploy a barley fertilizer application prediction model, and feed the collected barley planting data into the deployed barley fertilizer application prediction model in real time. According to the described data set construction method, when the model is actually used, the barley fertilizer application prediction can be started after 10 days of barley growth;
[0145] The barley fertilizer application prediction model is used cyclically during the entire barley growing period to monitor the barley growth, soil conditions and growing environment in real time, and the latest data is continuously collected using sensors to update the barley fertilizer application amount according to the latest situation;
[0146] Barley growers can predict the amount of fertilizer to be applied in the next week and use it as a reference for actual fertilization operations, helping barley growers to achieve intelligent fertilization operations.
[0147] 6. Experimental results prove
[0148] Since the long short-term memory network (LSTM), echo state network (ESN) and convolutional neural network (CNN) are currently reliable and stable prediction methods, the present invention selects these three prediction technologies to compare with the barley fertilizer application prediction method proposed in the present invention to verify the effectiveness of the method of the present invention. And the mean square error (MSE) and mean absolute percentage error (MAPE) are selected as evaluation indicators to evaluate the prediction error of the barley fertilizer application per mu (unit: kilograms). The smaller the MSE and MAPE, the closer the predicted value of the barley fertilizer application is to the true value. In addition, the field data collected in actual applications are prone to incomplete standardization. Therefore, the present invention adds the prediction of abnormal data in the comparative experiment to verify the actual reliability of this method. The experimental comparison results are as follows. Figure 5 and Figure 6 shown.
[0149] According to the experimental comparison results, it can be found that due to the use of the encoder structure based on self-attention, the method of the present invention can more fully extract features from the input data and obtain more accurate fertilizer application amount prediction results. In addition, when there are outliers in the input data, the prediction accuracy of LSTM, ESN and CNN is significantly reduced, and the multi-head attention mechanism introduced by the present invention can analyze and extract data from multiple angles, effectively suppress the prediction interference caused by abnormal data, thereby achieving higher prediction stability. Therefore, the intelligent fertilization method for barley cultivation proposed by the present invention has higher prediction accuracy and actual stability.
[0150] Embodiment 2:
[0151] The present invention also provides an intelligent fertilization device suitable for barley cultivation, the device includes at least one processor and at least one memory, and also includes a communication interface and an internal bus; a computer execution program is stored in the memory; a computer execution program of the intelligent fertilization model constructed by the construction method described in Example 1 is stored in the memory; when the processor executes the computer execution program stored in the memory, the processor can execute an intelligent fertilization method suitable for barley cultivation. The internal bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus. The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk memory, and may also be a U disk, a mobile hard disk, a read-only memory, a disk or an optical disk.
[0152] The device may be provided as a terminal, a server or other forms of devices.
[0153] The device may include one or more of the following components: a processing component, a memory, a power component, a multimedia component, an audio component, an input / output (I / O) interface, a sensor component, and a communication component. The processing component generally controls the overall operation of the electronic device, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component may include one or more processors to execute instructions to complete all or part of the steps of the above method. In addition, the processing component may include one or more modules to facilitate interaction between the processing component and other components. For example, the processing component may include a multimedia module to facilitate interaction between the multimedia component and the processing component.
[0154] The memory is configured to store various types of data to support operations on the electronic device. Examples of such data include instructions for any application or method operating on the electronic device, contact data, phone book data, messages, pictures, videos, etc. The memory can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0155] The communication component is configured to facilitate wired or wireless communication between the electronic device and other devices. The electronic device can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component also includes a near field communication (NEC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0156] In an exemplary embodiment, the electronic device may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above methods.
[0157] Embodiment 3:
[0158] The present invention also provides a computer-readable storage medium, in which a computer execution program of the intelligent fertilization model constructed by the construction method described in Example 1 is stored. When the computer execution program is executed by a processor, the processor can execute an intelligent fertilization suitable for barley cultivation.
[0159] Specifically, a system, device or equipment equipped with a readable storage medium may be provided, on which a software program code for implementing the functions of any of the above-mentioned embodiments is stored, and a computer or processor of the system, device or equipment reads and executes the instructions stored in the readable storage medium. In this case, the program code read from the readable medium itself can implement the functions of any of the above-mentioned embodiments, so the machine-readable code and the readable storage medium storing the machine-readable code constitute a part of the present invention.
[0160] The above storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk (such as CD-ROM, CD-R, CD-RW, DVD-20ROM, DVD-RAM, DVD-RW, DVD-RW), magnetic tape, etc. The storage medium can be any available medium that can be accessed by a general or special-purpose computer.
[0161] It should be understood that the storage medium is coupled to the processor so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can be located in an application specific integrated circuit (ASIC). Of course, the processor and the storage medium can also exist as discrete components in a terminal or server.
[0162] The computer-readable program instructions described herein can be downloaded from a computer-readable storage medium to each computing / processing device, or downloaded to an external computer or external storage device via a network, such as the Internet, a local area network, a wide area network, and / or a wireless network. The network can include copper transmission cables, optical fiber transmissions, wireless transmissions, routers, firewalls, switches, gateway computers, and / or edge servers. The network adapter card or network interface in each computing / processing device receives the computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in the computer-readable storage medium in each computing / processing device.
[0163] The computer program instructions for performing the disclosed operation may be assembly instructions, instruction set architecture (ISA) instructions, machine instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source code or object code written in any combination of one or more programming languages, including object-oriented programming languages, such as Smalltalk, C++, etc., and conventional procedural programming languages, such as "C" language or similar programming languages. Computer-readable program instructions may be executed completely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer, partially on a remote computer, or completely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., using an Internet service provider to connect via the Internet). In some embodiments, an electronic circuit, such as a programmable logic circuit, a field programmable gate array (FPGA), or a programmable logic array (PLA), may be personalized by utilizing the state information of the computer-readable program instructions, and the electronic circuit may execute the computer-readable program instructions, thereby realizing various aspects of the disclosed invention.
[0164] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
[0165] Although the above describes the specific implementation methods of the present invention, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A method for constructing an intelligent fertilization model for barley cultivation, characterized in that: The process includes: Step 1: Based on several groups of barley planting record data with yield and fertilizer application ratios that meet the requirements, an initial data set is constructed using m feature data that affect the final barley fertilizer application amount; wherein, the feature data recorded for each day are spliced together to obtain the spliced feature data d for one day, and the data d recorded for t days is used as the input information d* for the fertilizer application amount prediction, and the total barley fertilizer application amount O corresponding to the next week is used as the output; Step 2, feature screening is performed based on mutual information and correlation coefficient, n features with the highest correlation with the amount of fertilizer applied to barley are selected, and these features are used as input features to construct a standard data set; Step 3, constructing a barley fertilizer application prediction model based on a multi-head attention mechanism to predict the total fertilizer application amount of barley within a week corresponding to the barley growth period and different growth conditions; Step 4: Based on the standard data set in step 2 and a model training strategy based on sample reinforcement, the barley fertilizer application prediction model is trained to find the model parameters that optimize the model prediction performance and obtain the final intelligent fertilization model.
2. The method for constructing an intelligent fertilization model for barley cultivation according to claim 1, characterized in that: The m features in step 1 include eight features, namely, the average barley stalk height ZS during the barley planting period, the temperature ZT of the growing environment, the humidity ZM of the growing environment, the soil caking condition TJ, the soil nitrogen content TF, the soil moisture condition TM, the sunshine intensity condition S, and the carbon dioxide condition C in the air; and the recorded feature data of each day are spliced together to obtain the spliced feature data of one day d=[ZS, ZT, ZM, TJ, TF, TM, S, C]; The feature data vector d* and the barley fertilizer application amount O are combined to obtain a set of data d- and l sets of data d - Combine them together to get the initial data set; The normalization operation function is used to normalize the initial data set to obtain the normalized data D.
3. The method for constructing an intelligent fertilization model for barley cultivation according to claim 1, characterized in that: The specific process of step 2 is: S21, correlation coefficient calculation: Calculate the correlation coefficient K of the m characteristics during the barley planting period and the total amount of barley fertilizer O in sequence j , j∈[1,m]; Among them, X j Represents each feature data in turn, K j Indicates the correlation coefficient corresponding to each feature, COV(*) indicates the cross-correlation function, and VAR(*) indicates the variance solution function; S22, mutual information value calculation: sequentially calculate the mutual information value R of the m features during the barley planting period and the total amount of barley fertilizer O j , j∈[1,m]; R j =H(X j )+H(O)-HX(X j ,O) Among them, X j In turn, each feature data is represented, H(*) represents the information entropy solution function, and HX(*, *) represents the mutual information entropy solution function; S23, feature coefficient solution: The mutual information value R of each feature calculated based on S21 and S22 j And the correlation coefficient K of each feature j , R j Can find feature X from the perspective of information entropy j Correlation between barley fertilizer application rate O, K j Find feature X from the perspective of cross-correlation j The correlation between the fertilizer application amount O and barley is the mutual information value R j Assign a weight of 0.7, which is the correlation coefficient K j Assign a weight of 0.3, and then perform weighted summation to obtain the feature coefficient B of each feature. j ; <h2 style=";text-align:left;direction:ltr">B<h2 style=";text-align:left;direction:ltr"> j <h2 style=";text-align:left;direction:ltr"> <0.3K<h2 style=";text-align:left;direction:ltr"> j <h2 style=";text-align:left;direction:ltr"> +0.7R<h2 style=";text-align:left;direction:ltr"> j S24, based on the characteristic coefficient of each feature obtained by solving the process of S23, the larger the characteristic coefficient is, the higher the correlation with the amount of fertilizer applied is. The five features with the highest characteristic coefficients are selected to construct a standard data set.
4. The method for constructing an intelligent fertilization model for barley cultivation according to claim 1, characterized in that: The barley fertilizer amount prediction model based on the multi-head attention mechanism uses n groups of encoder modules corresponding to n features respectively. In order to enhance the ability of information extraction, each encoder module contains 6 encoders connected in sequence to perform deep extraction processing on the input features, and then uses the multi-head attention mechanism module to fuse the outputs of the n groups of encoder modules, and finally passes through a fully connected layer and a softmax activation function for output.
5. The method for constructing an intelligent fertilization model for barley cultivation according to claim 4, characterized in that: The encoder is specifically: In the encoder structure, for each input encoder feature X i , this feature first passes through an embedding layer to extract the feature information vector Emb of each feature i : Emb i =Embding(X i ) Among them, Embedding(*) represents the embedding layer operation function, Emb i Represents feature X i Feature information vector after being processed by the embedding layer; Then enter the self-attention mechanism module to perform feature calculation: the feature information vector Emb i It is sent to three fully connected layers (Q, W, L) for further processing, and features are extracted from multiple dimensions to obtain feature information Q in three different dimensions i , W i , V i : Q i =QLJ(Emb i ) IN i =WLJ(Emb i ) In i =VLJ(Emb i ) Among them, QLJ, WLJ, VLJ represent the layer operation functions of the fully connected layers Q, W, and L respectively, and then the feature information Q i , W i , V i After a linear layer and an activation function softmax, the fused feature information Zi is obtained; Z i =softmax(line(Q i ,W i ,V i )) Among them, line(*) represents the linear layer processing function.
6. The method for constructing an intelligent fertilization model for barley cultivation according to claim 4, characterized in that: The multi-head attention mechanism module is specifically: The output of the last encoder in the encoder module is defined as Among them, i∈[1,n], Encoder(*) represents the encoder module operation function. Since there are n different features, a multi-head attention mechanism is then used to analyze these n different features. Perform weighted processing to obtain feature cross-fusion information Z; Among them, ATT(*) represents the attention mechanism module operation function.
7. The method for constructing an intelligent fertilization model for barley cultivation according to claim 1, characterized in that: The model training strategy based on sample enhancement in step 4 is specifically as follows: The loss function L for the barley fertilizer application model was designed based on the mean square error loss function. C : Among them, Z represents the amount of fertilizer for barley predicted by the model in a single prediction; The specific process includes: S41, initialize the training weight of each group of data in the data set, where the total number of data samples is M, so the training weight of each sample is V w Set to: Among them, w∈[1,M], and the initial parameter in this barley fertilizer application prediction model is set to C0; S42, perform iterative model training and calculate the loss function result of the current iteration: L w =V w *L C Among them, L C is the loss result obtained by training the w-th sample, L w represents the loss result after weighting, LOSS1 represents the overall loss after the first iteration, and then the Adam optimizer is used to optimize the parameters based on LOSS1 to obtain the parameter values C1 of the barley fertilizer application prediction model after the first training; S43, update the weight of each group of training samples: Among them, q represents the update weight, and its value is 0.
6. represents the updated weight of the w-th sample; S44, repeat iterating S42 and S43 to the maximum number of iterations, the maximum number of iterations is set to TL and the overall loss LOSS of each iteration is obtained respectively x , x∈[1,TL], and the corresponding parameter q of the barley fertilizer application prediction model x , the model parameters corresponding to the minimum overall loss value are selected as the parameters of the final intelligent fertilization model.
8. An intelligent fertilization method for barley cultivation, characterized in that: The intelligent fertilization model constructed by the construction method according to any one of claims 1 to 7 is deployed to guide the fertilization operation of barley growers in the next week, and includes the following processes: Based on the n sets of features during model building, use the corresponding sensors to obtain real-time data; Input the acquired characteristic data into the trained intelligent fertilization model; Output the predicted fertilizer application amount for the next week as a reference for the actual fertilizer application operation.
9. An intelligent fertilization device for barley cultivation, characterized in that: The device includes at least one processor and at least one memory, the processor and the memory are coupled; the memory stores a computer execution program of the intelligent fertilization model constructed by the construction method according to any one of claims 1 to 7; when the processor executes the computer execution program stored in the memory, the processor executes an intelligent fertilization method suitable for barley cultivation.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer execution program of the intelligent fertilization model constructed by the construction method according to any one of claims 1 to 7. When the computer execution program is executed by the processor, the processor executes an intelligent fertilization method suitable for barley cultivation.
Citation Information
Patent Citations
Dynamic decision-making method and device for field irrigation and fertilization system
CN114662742A
Intelligent rice fertilizing method, system, equipment and medium
CN115952931A
Soil fertility evaluation and fertilization suggestion system and method based on deep learning
CN116703639A
Neural network-based crop fertilizer precise application method and system
CN117322214A
Crop yield prediction method based on adaptive feature selection and feature combination
CN118070960A
