Keywords

1 Introduction

Agricultural production is the pillar of a country's economy toward self-sustainable development [1]. Over the years, water and fertilizer resource management has spanned different stages and methods in different geographical locations according to availability [2,3,4,5]. Increasing crop yield and limiting adverse environmental impacts, is a widely stated goal in agricultural science [6]. More accurate application of water and fertilizer irrigation is regarded as one of the main means of this goal. Relative to crop demand, excessive application of nutrients will not only reduce farm profits but also degrade the environment [7]. Excessive irrigation will unsustainably deplete groundwater and streams, while excessive fertilization will rapidly reduce soil fertility, and a large number of chemical residues will endanger human health. Therefore, a large number of studies have proved that it is very important to develop a scientific decision-making and control method for water and fertilizer irrigation to better meet the needs of crops for water and nutrients at different times [8,9,10]. Scientific irrigation can not only effectively regulate the absorption and transfer of nutrients, but also improve the photosynthesis and transpiration of leaves, the division, and growth of plant tissues and cells, as well as the synthesis and transformation of organic substances. It can significantly promote the growth of cabbage leaf bulbs and coordinate the physiological activities of cabbage crops. To promote the healthy development of the soil micro-ecosystem, ensure the water and nutrient balance of greenhouse vegetables, and achieve high-quality production, it is very important to seek scientific irrigation and fertilization schedules.

The management and control of water and fertilizer nutrient solution have been systematically studied at home and abroad [11, 12]. At present, the regulation of nutrient solution is mainly based on the EC Value and pH value of nutrient solution at home and abroad [13], at the same time, this method is most widely used in actual production. Most studies on nutrient solution management and control system are also based on this control mode [14,15,16,17,18]. Some scholars use the cyclic neural network to predict the EC nutrient in the root zone of pepper in closed-loop soilless cultivation management, and have achieved good results [19]. Others use the mixed signal processing method based on the neural network to predict and analyze the ion distribution in the hydroponic solution [20]. However, the way of using multi-source data based on deep learning method to make the management decision of greenhouse cabbage nutrient solution still needs to be studied, Therefore, we propose an improved convolution neural network CNN and two-way long-term and short-term memory network AT-CNN-BiLSTM neural network model based on attention mechanism to solve this problem. The purpose is to deeply mine the existing data and accurately determine the amount of nutrient solution for water and fertilizer irrigation in real time.

2 Materials and Methods

2.1 Data Acquisition

Fig. 1.
figure 1

Location and overview of test site.

From September 2020 to March 2021, the water and fertilizer irrigation experiment of greenhouse cabbage was carried out in the No. 14 Solar Greenhouse of Beijing National precision agriculture research demonstration base (Fig. 1). Its geographical location is 116.26 °E, 40.10 °N, with an altitude of about 50 m. The planting area belongs to a temperate continental monsoon climate, and the temperature is appropriate. The test greenhouse is 50 m long and 7.5 m wide. It is composed of an arched steel frame structure. The maximum height in the middle is about 3 m. Crops are planted in the east-west direction, and north-south direction, and covered with polyethylene trickle anti-aging film on the sunny side. A large number of intelligent control devices are set in the greenhouse. In combination with the current software and hardware configuration of the greenhouse, 26 ridges were built in the test area, with an average ridge spacing of 1.5 m and a ridge top width of 0.8 m. Two rows of cabbage were planted on each ridge, with a plant spacing of 0.3 m and a row spacing of 0.5 m. The planting density was 2402 plants/667 m2.

In the experiment, according to the different water and nutrient requirements of cabbage in different growth cycles, 12 cabbage plants with basically the same growth potential were selected for observation in each plot at the cabbage seedling stage, and the data of plant height, stem diameter (rhizome), number of leaves and width of their aboveground parts were collected day by day (among them, the stem diameter was measured by electronic vernier caliper, and the plant height and width were measured by a ruler with an accuracy of 0.01 mm). 1440 groups of cabbage growth potential data were obtained. At the same time, the WS-1800 remote meteorological monitoring station is used to monitor the greenhouse micrometeorological data. The measurement parameters include air temperature, relative humidity, wind speed, and solar radiation intensity. The collection frequency is preset to 4 pieces/minute. After the meteorological station obtains the data, the data is transmitted back through the RS485 bus, and 691200 pieces of meteorological data are selected as the basis for the construction of the greenhouse meteorological data set. The current scientific daily irrigation method of a small number of times is adopted for water and fertilizer irrigation, and the daily water and fertilizer consumption is recorded through data monitoring equipment.

2.2 Identification of Influencing Factors and Coupling Verification

This study also considers the data parameters related to internal and external factors of cabbage that are constantly changing in the process of water and fertilizer irrigation in the greenhouse. It is expected to further determine the rationality of the multi-source data set by analyzing the interaction between internal and external factors and the correlation between this factor and water and fertilizer irrigation decisions and eliminate invalid data to avoid interference with the prediction effect of the model, Improve the prediction accuracy of water and fertilizer irrigation amount of greenhouse cabbage.

External Factors.

The external factors affecting the irrigation amount of water and fertilizer for greenhouse cabbage mainly include air temperature, relative humidity, solar radiation intensity, EC value, pH value and temperature of nutrient solution, and potential evapotranspiration of greenhouse cabbage. Because there are two opposite physiological processes of assimilation and dissimilation in the process of crop growth, in this process, crops continuously accumulate organic matter. When the organic matter produced by assimilation is greater than dissimilation, crops show a growth trend, and temperature has an important impact on this process. Dissolving fertilizer in water to form organic nutrient solution to irrigate cabbage. At this time, the fertility of nutrient solution is the main concern of irrigation. Appropriate EC value, pH value and irrigation temperature of nutrient solution can promote the absorption and growth of cabbage nutrients, while excessive or small amount will have a negative impact on the growth of cabbage. Generally, when the fertility is too large, we need to carry out crop leaching to avoid fertilizer damage.

Internal Factors.

 The internal factors that affect the irrigation amount of water and fertilizer in greenhouse are the growth morphological parameters of cabbage, such as plant height, stem diameter, leaf number and plant width. Among them, cabbage plant height refers to the straight-line distance from the root of the plant to the highest part of the plant. Excessive irrigation will lead to overgrowth of the plant and unable to support the growth of leaf bulbs. Appropriate irrigation plays a positive role in plant height growth. Stem diameter refers to the diameter of the root and stems at 1cm from the ground surface, the number of leaves refers to the number of fresh leaves surviving in the growth process of cabbage, and the width refers to the span length parallel to the ridge width of cabbage.

Coupling Relationship Verification.

 Collect and sort out the irrigation related data in the whole growth cycle of greenhouse cabbage, and get the initial data of different indicators (Table 1). The importance of each indicator is determined by the entropy method, and the grey correlation analysis method is used to measure the correlation between the factors that change with time.

Table 1. Data indicators.

During the training process of neural network model, the potential features of data are continuously extracted through the optimization and adjustment of parameters, and this process is very time-consuming. In order to avoid the negative impact of data on the model training and prediction results, the entropy method (Table 2) and grey correlation analysis method (Table 3) were used to verify the coupling relationship between the model input data, and the input variables were analyzed through entropy calculation and correlation. Entropy method is a method to reflect the disorder degree of information in information theory. The smaller the value, the lower the disorder degree and the greater the weight; On the contrary, the larger the value, the higher the degree of disorder and the smaller the weight. Grey correlation analysis judges the close relationship between data by determining the geometric similarity between the target data column and other comparison data columns. It is usually used to reflect the influence degree between data curves, and can also be used to solve the systematic analysis of comprehensive evaluation problems. Its core idea is to determine the parent sequence according to specific rules, take the object to be evaluated as a sub sequence, and solve the correlation degree between each sub sequence and the parent sequence, And draw a conclusion.

Table 2. Calculation results of entropy method.

When analyzing the data coupling relationship with the grey correlation degree, if the change trends of the two elements are consistent, it means that the correlation between them is very high; On the contrary, the correlation is low. When the correlation degree ranges from 0.00 to 0.35, it means that the correlation is low and the coupling effect is very weak; When the correlation degree ranges from 0.35 to 0.45, it means low correlation and weak coupling; When the correlation degree ranges from 0.45 to 0.65, it indicates medium correlation and medium coupling; When the correlation degree ranges from 0.65 to 0.85, it indicates high correlation and strong coupling; When the correlation degree ranges from 0.85 to 1.00, it means extremely high correlation and strong coupling.

Table 3. Results of grey relational analysis.

3 Intelligent Decision-Making Irrigation Model of Water and Fertilizer

In recent years, the use of the attention mechanism has made remarkable achievements in image recognition and document classification. It can select the information that is the most critical to the current task target from a large amount of information, capture the sequence and mark the remote dependency between the context information. For traditional convolutional neural networks and cyclic neural network, the contribution value of each eigenvector is the same, and the difference between them is ignored. In this paper, the attention mechanism is used to predict the irrigation amount of vegetable water and fertilizer. It selectively pays more attention to some important information, and assigns the corresponding weight to the output characteristics of BiLSTM neural network, to promote the model to get better prediction results. In this paper, the CNN BiLSTM greenhouse cabbage water and fertilizer intelligent decision irrigation model (AT-CNN-BiLSTM model for short) based on attention mechanism is improved. The model mainly adds an attention mechanism layer based on CNN BiLSTM model and enriches the preprocessing analysis of multi-source data and the adjustment of parameters at each layer. Its network structure is shown in Fig. 2.

After preprocessing the greenhouse multi-source irrigation data, Xi represents the ith parameter of the input sample, and T represents the time length of the sample. The processed data set is transmitted to the CNN layer, and the convolution layer is also used for convolution operation. Here, the new features generated by the convolution layer can be expressed as:

$$C_{i}^{k} = f\left( {x_{i} \otimes W_{k} + b_{k} } \right)$$
(1)
Fig. 2.
figure 2

AT-CNN-BiLSTM neural network structure.

Where represents the convolution operator; W is the weight vector of the convolution kernel; B is the offset term; f (·) represents the nonlinear excitation function. The activation function of the hidden layer adopts the relu function, which can avoid abnormal problems such as slow convergence and local maximum caused by the disappearance of the gradient. k different convolution kernels are set to promote the comprehensiveness of data feature extraction. After the convolution operation, the maximum pooling function is used for the pooling operation. The specific process can be expressed as follows:

$$C_{m} = \left[ {C_{1} ,C_{2} , \ldots ,C_{n - k + 1} } \right]$$
(2)
$$P_{m} = \max \left( {C_{m} } \right)$$
(3)

Taking advantage of the bi-directional feature extraction of BiLSTM, considering the interaction between each data in the greenhouse cabbage sequential growth environment data and its forward and backward data, we can use the data features at this time point to obtain the backward unit through the forward LSTM unit. In the experiment, in order to capture the long-distance dependence feature, Pm is input into the BiLSTM model, which is connected by LSTM modules in two directions and has multiple shared weights. At each time step t, each gate is represented by the output of the previous module and the input Pt at the current time. The three gates work together to complete the selection of attribute information, forgetting and updating of cell status.

In order to obtain more accurate prediction accuracy, the output results of BiLSTM are input to the attention mechanism layer. The attention mechanism can highlight the key features that affect the irrigation volume, reduce the impact of non key features on irrigation, help the BiLSTM layer make predictions, and will not increase the calculation and storage costs of the model. The weight calculation formula of the attention mechanism can be expressed as:

$$e_{t} = u_{a} \tanh (w_{a} h_{t} + b_{a} )$$
(4)
$$a_{t} = \frac{{\exp (e_{t} )}}{{\sum\nolimits_{j = 1}^{t} {\exp (e_{j} )} }}$$
(5)

where, ht represents the hidden layer state vector of BiLSTM neural network at time t; et represents the attention probability distribution value; at indicates attention score; ua and wa are attention weight vectors; ba is the attention bias vector.

4 Results and Discussion

The establishment of a model to predict the next day irrigation amount of greenhouse cabbage belongs to the category of regression problem. Therefore, root mean square error (RMSE) and mean absolute error (MAE) are selected as the model evaluation indicators, and the formulas are shown in Eqs. (6) and (7).

$$RMSE = \sqrt {\frac{{\sum\nolimits_{i = 1}^{n} {\left( {P_{i} - Q_{i} } \right)^{2} } }}{n}}$$
(6)
$$MAE = \frac{1}{n}\sum\nolimits_{i = 1}^{n} {\left| {P_{i} - Q_{i} } \right|}$$
(7)

4.1 Comparison of Prediction Performance of Different Models

It can be seen from Table 4 that when different variable factors are used as model inputs, the AT-CNN-BiLSTM model proposed in this paper has the best effect, and its RMSE and Mae values are the lowest among the three neural network models, of which the RMSE variation range is 0.0024 m3/day–0.0030 m3/The MAE range is 0.0017–0.0025 m3/Between days, it shows that the prediction accuracy of the improved model is effectively improved by using the attention mechanism method, which confirms the necessity of introducing the attention mechanism method.

Table 4. Comparison of prediction performance of the model under different input factors.

4.2 Analysis of Factors Affecting the Prediction Performance of the Model

As shown in Fig. 3, three different time-series neural network models, BiLSTM, CNN BiLSTM and AT-CNN-BiLSTM, have shown good prediction effect on the irrigation amount per plant of greenhouse cabbage in the day after the prediction of the previous day's greenhouse cabbage growth environment data, and the irrigation trend is basically the same as the standard value. From the perspective of the factors affecting the prediction performance of the model, the multi-source data has a greater impact on the final water and fertilizer irrigation amount of cabbage. The model takes a variety of data variables as inputs, and the prediction effect is better than other inputs. The prediction result of internal factors is the second, and the effect of external factors is the worst. Due to the complexity of cabbage growth environment, the influencing factors on irrigation amount are complex and diverse. Under the condition of frequent farming operations, there are still defects in using external influencing factors alone to predict irrigation amount of water and fertilizer. However, prediction based on multi-source data can consider the coupling relationship between variables more, increase the amount of information and the effective basis for decision-making.

Fig. 3.
figure 3

Comparison between predicted and standard values of irrigation volume of different models.

4.3 Prediction Error Analysis of Water and Fertilizer Irrigation Quantity

In the process of greenhouse irrigation decision-making and control, the size of irrigation error plays a vital role in cultivation management. The smaller the calculation error is, the more balanced the supply and demand is. Only in this way can crop growth be guaranteed, and water and fertilizer disasters are not easy to occur, which will negatively affect crop production. It can be seen from Fig. 4 that the prediction accuracy of three different models with the same prediction trend and real value is more obvious. Among them, the AT-CNN-BiLSTM model proposed in this paper is better, followed by the other two models.

Fig. 4.
figure 4

Comparison of prediction accuracy of different models.

4.4 Model Stability Analysis

The AT-CNN-BiLSTM model has shown good prediction performance in the time series prediction of greenhouse cabbage irrigation. To further confirm the stability of the model and weaken the contingency of high-precision the model, BiLSTM, CNN BiLSTM and AT-CNN-BiLSTM were executed 10 times respectively, and the change range and abnormal performance of RMSE were compared. It can be seen from Fig. 5 that the RMSE variation range of the at-cnn-bilstm model is always 0.0224 ~ 0.0319 m3/There is no abnormal value between days, indicating that the AT-CNN-BiLSTM model has the best stability. Secondly, the RMSE of BiLSTM model varies from 0.00246 to 0.00409 m3/Day. After the CNN BiLSTM model was executed 10 times, the RMSE changed greatly and did not show good stability.

Fig. 5.
figure 5

Comparison of model stability.

5 Conclusion

On the premise of realizing the intelligent decision-making irrigation of water and fertilizer for greenhouse cabbage, this paper uses the front and back characteristics of original time series data and multi-scale high-level front and back characteristics to predict and analyze the irrigation amount of water and fertilizer in the joint architecture of convolution neural network and cyclic neural network, and puts forward an AT-CNN-BiLSTM neural network model with attention mechanism to predict the irrigation amount of the next day, and analyzes the application effect of the model in actual production, The validity and usability of the model are verified by experiments, which provides great help for the intelligent management of vegetable water and fertilizer.