Keywords

1 The Introduction

Food relationship between the survival of human beings, the quality of the food relationship with human nutrition and health, focus on quality of food that has existed since ancient times, and one of the important indicators affecting the quality of grain storage is the temperature of the grain heap, for effective monitoring of the temperature of the grain heap can prevent the grain mildew occurred in the process of storage and so on the change of the quality. Therefore, the prediction of grain heap temperature has become a hot spot of intelligent temperature control. At present, some scholars at home and abroad have done a lot of research on temperature prediction, such as: Tian Xiaomei et al. predicted and controlled the temperature of grain drying tower based on information entropy [1], Wang Xiaomin et al. predicted hot metal temperature based on the image brightness of blast furnace tuyere [2], and Bin Lu et al. predicted and analyzed the air temperature inside the tunnel during operation period [3]. So temperature prediction has become a hot topic today.

The temperature prediction using LSTM neural network has become an important research content. Because the temperature is a kind of temporal data, the temperature forecast is a prediction based on time sequence, while the LSTM is a kind of neural network based on time sequence forecast, however the LSTM only on the basis of a moment before the moment of temporal information to predict the output of the next moment, at a certain moment can’t focus on the future at a certain moment with the current relationship. Therefore, the LSTM neural network is improved to obtain the bidirectional LSTM neural network. It predicts the output based on the temporal sequence information of the time before and in the future, discovers more data features and obtains more accurate and sufficient prediction rules. In this paper, according to the implementation plan of shallow ground energy and air-cooled grain pile surface temperature control green grain storage technology research project of Wuhan National Rice Exchange Center Co., LTD., the grain pile temperature data at 8, 14 and 20 o’clock from June 29 to September 3 were collected, then the data is preprocessed. Based on the processed data, the bidirectional LSTM neural network to realize the grain heap temperature prediction, compared with the LSTM neural network, the results show that the prediction accuracy of the bidirectional LSTM neural network is higher than the LSTM neural network. At the end of the experiment, the bidirectional LSTM and RNN neural network, bidirectional RNN neural network, GRU neural network and bidirectional GRU neural network are comprehensively compared and analyzed. The results show that bidirectional LSTM is closer to the real value and has better prediction results than RNN, bidirectional RNN, GRU and bidirectional GRU. Therefore, we can take corresponding measures to adjust the temperature of the grain heap according to the more accurate prediction results of the bidirectional LSTM, so as to reduce the possibility of grain quality decline caused by high temperature storage problems, and ultimately effectively ensure the quality of grain.

2 Materials and Methods

2.1 Sample Collection and Preparation

The temperature data of the bottom and surface layer of grain stacks at 8, 14 and 20 o’clock from June 29 to September 3 collected by the implementation plan of shallow ground energy and air cooling process Grain stack Surface temperature control Green grain Storage Technology Research Project of Wuhan National Rice Exchange Center Co., LTD. Then the LSTM and bidirectional LSTM, RNN, bidirectional RNN, GRU, the bidirectional GRU neural network structure models are established respectively. Finally, the processed data are trained and predicted by the LSTM and bidirectional LSTM, RNN, bidirectional RNN, GRU, the bidirectional GRU neural network respectively.

2.2 Experimental Flow Analysis

Fig. 1.
figure 1

Experimental processing flow of training set

By experiment flow Fig. 1, because the data contains null values, so, we need to preprocess the data, and then the processed data is divided into two parts, one part of the data is the training set of the neural network and the other part of the data is the test set of the neural network, the training set is divided into the input and output sets. Firstly, we need to train the LSTM and bidirectional LSTM, RNN, bidirectional RNN, GRU, the bidirectional GRU neural network model on the data in the training set. Its purpose is to make the results of the neural network trained by the input set better fit the output set.

Fig. 2.
figure 2

Experimental processing flow of test set

As shown in experimental flow Fig. 2, the test set is input into trained the LSTM and bidirectional LSTM, RNN, bidirectional RNN, GRU and bidirectional GRU neural network models, and then the prediction is made. We compared the predicted result set of LSTM and bidirectional LSTM, RNN, bidirectional RNN, GRU, bidirectional GRU neural network model with the real result set. In order to be more intuitive, the graphs predicted by then LSTM and bidirectional LSTM, RNN, bidirectional RNN, GRU, bidirectional GRU neural network model are compared with those of real data more intuitively, through the comparison of the predicted value and the analysis of the numerical error and the trend comparison of the forecast graph, It is concluded that which of LSTM and bidirectional LSTM, bidirectional RNN, bidirectional RNN, GRU and bidirectional GRU neural network models has the best prediction effect.

3 Results

3.1 LSTM Neural Network Model and Bidirectional LSTM Neural Network Model Training and Error Comparative Analysis

Table 1. LSTM and bidirectional LSTM neural network models for grain pile bottom prediction results

It can be seen from the predicted results in Table 1 that: The error between the actual value of 8 o’clock on September 2nd and the predicted value of LSTM neural network is 1.33, the error between the actual value of 14 o’clock on September 2nd and the predicted value of LSTM neural network is 1.54, and the error between the actual value of 20 o’clock on September 2nd and the predicted value of LSTM neural network is 1.52. The error between the actual value of 8 o’clock on September 3rd and the predicted value of LSTM neural network is 1.48, the error between the actual value of 14 o’clock on September 3rd and the predicted value of LSTM neural network is 1.48, the error between the actual value of 20 o’clock on September 3rd and the predicted value of LSTM neural network is 1.47.

The error between the actual value of 8 o’clock on September 2nd and the predicted value of bidirectional LSTM neural network is 0.2, the error between the actual value of 14 o’clock on September 2nd and the predicted value of bidirectional LSTM neural network is 0.44, the error between the actual value of 20 o’clock on September 2nd and the predicted value of bidirectional LSTM neural network is 0.42. The error between the actual value of 8 o’clock on September 3rd and the predicted value of bidirectional LSTM neural network is 0.34, the error between the actual value of 14 o’clock on September 3rd and the predicted value of bidirectional LSTM neural network is 0.41, and the error between the actual value of 20 o’clock on September 3rd and the predicted value of bidirectional LSTM neural network is 0.34. It can be seen from the above six results that the predicted value of the grain pile bottom of the bidirectional LSTM neural network is closer to the actual value than that of the LSTM neural network.

Table 2. Prediction results of grain pile surface based on LSTM and bidirectional LSTM neural network models

It can be seen from the predicted results in Table 2 that: The error between the actual value of 8 o’clock on September 2nd and the predicted value of LSTM neural network is 0.72, the error between the actual value of 14 o’clock on September 2nd and the predicted value of LSTM neural network is 0.69, and the error between the actual value of 20 o’clock on September 2nd and the predicted value of LSTM neural network is 0.68. The error between the actual value of 8 o’clock on September 3rd and the predicted value of LSTM neural network is 0.43; the error between the actual value of 14 o’clock on September 3rd and the predicted value of LSTM neural network is 0.6; the error between the actual value of 20 o’clock on September 3rd and the predicted value of LSTM neural network is 0.6.

The error between the actual value of 8 o’clock on September 2nd and the predicted value of bidirectional LSTM neural network is 0.03, the error between the actual value of 14 o’clock on September 2nd and the predicted value of bidirectional LSTM neural network is 0.04, and the error between the actual value of 20 o’clock on September 2nd and the predicted value of bidirectional LSTM neural network is 0.03. The error between the actual value of 8 o’clock on September 3rd and the predicted value of bidirectional LSTM neural network is 0.21, the error between the actual value of 14 o’clock on September 3rd and the predicted value of bidirectional LSTM neural network is 0.15, and the error between the actual value of 20 o’clock on September 3rd and the predicted value of bidirectional LSTM neural network is 0.17. It can be seen from the above 6 results that the predicted value of grain pile surface of bidirectional LSTM neural network is closer to the actual value than that of LSTM neural network.

3.2 RNN, Bidirectional RNN, GRU, Comparative Analysis of Training and Error of Bidirectional GRU Network Models

Table 3. Prediction results of grain pile bottom based on RNN, bi-directional RNN, GRU and bi-directional GRU neural network

It can be seen from Table 1 that the error between the prediction result of the bidirectional LSTM neural network model and the actual value of grain pile bottom is within 0.45. Table 1 combined with Table 3 shows that the prediction result of bidirectional LSTM neural network is smaller than the prediction error of GRU, bidirectional GRU, RNN and bidirectional RNN at each time.

Table 4. Grain pile surface prediction results of RNN, bi-directional RNN, GRU, bi-directional GRU neural network

It can be seen from Table 2 that the error between the prediction result of grain pile surface and the actual value of the bidirectional LSTM neural network model is within 0.04. According to Table 2 and Table 4, the prediction result of bidirectional LSTM neural network is smaller than the prediction error of GRU, bidirectional GRU, RNN and bidirectional RNN at each time.

3.3 Comparison and Analysis of LSTM Neural Network Model and Bidirectional LSTM Neural Network Model

Fig. 5.
figure 3

Line graph of underlying temperature prediction for LSTM and bidirectional LSTM neural network models (Color figure online)

Fig. 6.
figure 4

Line graph of surface temperature prediction for LSTM and bidirectional LSTM neural network models (Color figure online)

The abscissa 1, 2 and 3 in Fig. 5 and Fig. 6 respectively represent the three moments at 8:00 in the morning, 14 in the afternoon and 20 in the evening of the penultimate day. Abscissa 4, 5 and 6 in Fig. 5 and Fig. 6 respectively represent the three moments at 8:00 in the morning, 14:00 in the afternoon and 20:00 in the evening on the last day. The ordinate represents temperature. The green broken line is the actual value of grain heap temperature, the yellow broken line is the predicted value of grain heap temperature of bidirectional LSTM, and the blue broken line is the predicted value of grain heap temperature of LSTM. Figure 5 is the broken line diagram of the prediction of bottom temperature of LSTM and bidirectional LSTM. Figure 6 is the broken line diagram of the prediction of surface temperature of LSTM and bidirectional LSTM. Figure 6 shows intuitively that the predicted value of bidirectional LSTM neural network in grain heap temperature is closer to the actual value of grain heap temperature than the predicted value of LSTM neural network in grain heap temperature. Therefore, the error between the bidirectional LSTM and the actual value is smaller, and it has a better application prospect in grain stack temperature.

3.4 Comparison and Analysis of the Training Results of Bidirectional LSTM Neural Network Model and RNN, Bidirectional RNN, GRU, Bidirectional GRU Network Model

Fig. 7.
figure 5

Line diagram of bidirectional LSTM neural network model and underlying temperature prediction of GRU, bidirectional GRU, RNN and bidirectional RNN

Fig. 8.
figure 6

The broken line diagram of bidirectional LSTM neural network model and surface temperature prediction of GRU, bidirectional GRU, RNN and bidirectional RNN

The abscissa 1, 2 and 3 in Fig. 7 and Fig. 8 respectively represent the three moments at 8:00 in the morning, 14 in the afternoon and 20 in the evening of the penultimate day. Abscissa 4, 5 and 6 in Fig. 7 and Fig. 8 respectively represent the three moments at 8:00 in the morning, 14:00 in the afternoon and 20:00 in the evening on the last day. The ordinate represents temperature. The gray broken line is the actual value of grain heap temperature, the blue broken line is the predicted value of grain heap temperature of bidirectional LSTM, the yellow broken line is the predicted value of grain heap temperature of GRU, the green broken line is the predicted value of grain heap temperature of bidirectional GRU, the red broken line is the predicted value of grain heap temperature of RNN, the purple broken line is the predicted value of grain heap temperature of bidirectional RNN, It can be seen intuitively from Fig. 7 and Fig. 8 that the predicted value of bidirectional LSTM neural network in grain heap temperature is closer to the actual value of grain heap temperature than that of other neural networks. Therefore, the error between the bidirectional LSTM and the actual value is smaller, and it has a better application prospect in grain stack temperature.

4 Conclusions

In this paper, a temperature prediction model based on bidirectional LSTM is proposed. Firstly, the advantages and disadvantages of LSTM neural network are introduced. Then, the bidirectional LSTM neural network prediction model is derived from the shortcomings of LSTM neural network. Firstly, the temperature data of the bottom and surface layer of the grain heap at 8, 14 and 20 o’clock from June 29 to September 3 collected by the shallow ground energy and air-cooled grain heap temperature control green grain storage technology research project of Wuhan National Rice Exchange Center Co., LTD were preprocessed. The simulated test was carried out using the LSTM neural network and the improved LSTM neural network, that is, the bidirectional LSTM neural network. It can be seen from the data results and line chart of the simulation test that the prediction results of LSTM and bidirectional LSTM are close to the actual value, but the predicted value of bidirectional LSTM is closer to the real value than that of LSTM, and has better prediction results. At the end of the experiment, the bidirectional LSTM and RNN neural network, bidirectional RNN neural network, GRU neural network and bidirectional GRU neural network are comprehensively compared and analyzed. The results show that bidirectional LSTM is closer to the real value and has better prediction results than RNN, bidirectional RNN, GRU and bidirectional GRU. Finally, the bidirectional LSTM has a better application prospect.