Field Data Forecasting Using LSTM and Bi-LSTM Approaches
Abstract
:1. Introduction
2. Materials and Methods
- Step 1—Data Collection: the relevant data are measured using sensors and collected on a cloud database;
- Step 2—Data Preprocessing: the missing data and irrelevant data will be processed in this step. A new clean dataset is the most important outcome;
- Step 3—Modeling and Pattern Selection: both LSTM and Bi-LSTM forecasting models are created. Moreover, a set of hyperparameters is tuned to obtain the best performance from the model. the hyperparameters in our case are the parameters that affect the performance of the proposed model comprising time step, batch size, epoch, learning rate, and split ratio;
- Step 4—Evaluation and Interpretation: the proposed model will be trained, tested, and validated based on the collected data.
2.1. Data Collection (Study Area)
- Soil sensor: used to monitor the real-time soil moisture, soil temperature, soil pH, and soil electrical conductivity (EC) which impact crops growth and health;
- Air indoor sensor: used to monitor the real-time air temperature, relative humidity, UV index, and light intensity, which help to control the crops environment and maintain it as suitable to crop production inside the greenhouse;
- Outdoor weather station: used to monitor the weather parameters outside the greenhouse comprising air temperature, relative humidity, UV, light intensity, rainfall or precipitation, and wind speed, which also impact the environment inside the greenhouse
2.2. Data Preprocessing
2.3. Modeling and Pattern Selection
2.3.1. Proposed model
2.3.2. Hyperparameters Selection
- The learning rate (LR) is one of the hyperparameters that controls the change in the model in response to the estimated error each time the weights of model are updated;
- The split ratio (SR) is the split interval of the dataset for training and testing.
3. Results
3.1. Test Setup
3.2. Results and Discussion
4. Conclusions and Future Works
Author Contributions
Data Availability Statement
Acknowledgments
Conflicts of Interest
Appendix A. Dataset
References
- IndiaAgroNet. Importance of Water Management in Crop Production. Available online: https://www.indiaagronet.com/indiaagronet/water_management/water_3.htm (accessed on 16 October 2021).
- Devanand Kumar, G.; Vidheya Raju, B.; Nandan, D. A Review on the Smart Irrigation System. J. Comput. Theor. Nanosci. 2020, 17, 4239–4243. [Google Scholar] [CrossRef]
- Khan, G.; Dhakate, K.; Kambe, S.; Meshram, S.; Lunge, A. A Review on Arduino Based Smart Irrigation System. IJSRST 2018, 4, 623–630. [Google Scholar]
- FAO AQUASTAT. FAO’s Global Information System on Water and Agriculture. Available online: https://www.fao.org/aquastat/en/overview/methodology/water-use (accessed on 16 October 2021).
- Sarah Massingham. World Water Usage Made by Sarah Massingham—Home. Available online: https://waterusagecqu.weebly.com/ (accessed on 16 October 2021).
- Chart: Globally, 70% of Freshwater Is Used for Agriculture. Available online: https://blogs.worldbank.org/opendata/chart-globally-70-freshwater-used-agriculture (accessed on 16 October 2021).
- OECD. Environmental Outlook to 2050: What Could the Environment Look Like in 2050? 2012. Available online: https://www.oecd.org/env/indicators-modelling-outlooks/49846090.pdf (accessed on 16 October 2021).
- Oukaira, A.; Benelhaouare, A.Z.; Kengne, E.; Lakhssassi, A. FPGA-Embedded Smart Monitoring System for Irrigation Decisions Based on Soil Moisture and Temperature Sensors. Agronomy 2021, 11, 1881. [Google Scholar] [CrossRef]
- Bozdemir, M.; Bayramoğlu, Z.; Ağızan, K.; Ağızan, S. Prudential Expectation Analysis in Maize Production. Turk. J. Agric.-Food Sci. Technol. 2019, 7, 390–400. [Google Scholar] [CrossRef]
- Lamm, F.R.; Rogers, D.H. The Importance of Irrigation Scheduling for Marginal Capacity Systems Growing Corn. Appl. Eng. Agric. 2015, 31, 261–265. [Google Scholar] [CrossRef] [Green Version]
- Mahlein, A.-K.; Oerke, E.-C.; Steiner, U.; Dehne, H.-W. Recent advances in sensing plant diseases for precision crop protection. Eur. J. Plant Pathol. 2012, 133, 197–209. [Google Scholar] [CrossRef]
- Shopping for a Smart Irrigation System? Available online: https://www.loveyourlandscape.org./expert-advice/water-smart-landscaping/smart-irrigation/shopping-for-a-smart-irrigationsyste.m/ (accessed on 16 October 2021).
- Adab, H.; Morbidelli, R.; Saltalippi, C.; Moradian, M.; Ghalhari, G.A.F. Machine learning to estimate surface soil moisture from remote sensing data. Water 2020, 12, 3223. [Google Scholar] [CrossRef]
- Cai, Y.; Zheng, W.; Zhang, X.; Zhangzhong, L.; Xue, X. Research on soil moisture prediction model based on deep learning. PLoS ONE 2019, 14, e0214508. [Google Scholar] [CrossRef] [PubMed]
- Hajjar, C.S.; Hajjar, C.; Esta, M.; Chamoun, Y.G. Machine learning methods for soil moisture prediction in vineyards using digital images. ICESD 2020, 167, 2004. [Google Scholar] [CrossRef]
- Hu, Z.; Xu, L.; Yu, B. Soil moisture retrieval using convolutional neural networks: Application to passive microwave remote sensing. Int. Arch. Photogramm. Remote Sens. Spat. Inf. Sci. 2018, 42, 583–586. [Google Scholar] [CrossRef] [Green Version]
- Gorthi, S.; Dou, H. Prediction models for the estimation of soil moisture content. DETC 2011, 54808, 945–953. [Google Scholar] [CrossRef] [Green Version]
- Karandish, F.; Šimůnek, J. A comparison of numerical and machine-learning modeling of soil water content with limited input data. J. Hydrol. 2016, 543, 892–909. [Google Scholar] [CrossRef] [Green Version]
- Yu, J.; Tang, S.; Zhangzhong, L.; Zheng, W.; Wang, L.; Wong, A.; Xu, L. A Deep Learning Approach for Multi-Depth Soil Water Content Prediction in Summer Maize Growth Period. IEEE Access. 2020, 8, 199097–199110. [Google Scholar] [CrossRef]
- Fang, K.; Kifer, D.; Lawson, K.; Shen, C. Evaluating the potential and challenges of an uncertainty quantification method for long short-term memory models for soil moisture predictions. Water Resour. Res. 2020, 56, e2020WR028095. [Google Scholar] [CrossRef]
- Zhang, D.; Zhang, W.; Huang, W.; Hong, Z.; Meng, L. Upscaling of surface soil moisture using a deep learning model with VIIRS RDR. ISPRS Int. J. Geo-Inf. 2017, 6, 130. [Google Scholar] [CrossRef]
- Ge, L.; Hang, R.; Liu, Y.; Liu, Q. Comparing the performance of neural network and deep convolutional neural network in estimating soil moisture from satellite observations. Remote Sens. 2018, 10, 1327. [Google Scholar] [CrossRef] [Green Version]
- Song, X.; Zhang, G.; Liu, F.; Li, D.; Zhao, Y.; Yang, J. Modeling spatio-temporal distribution of soil moisture by deep learning-based cellular automata model. J. Arid Land. 2016, 8, 734–748. [Google Scholar] [CrossRef] [Green Version]
- Samaya Madhavan, M. Tim Jones, Deep Learning Architectures, The Rise of Artificial Intelligence. 2021. Available online: https://developer.ibm.com/articles/cc-machine-learning-deep-learning-architectures/ (accessed on 15 October 2021).
- Mohammad-Parsa, H.; Lu, S.; Kamaraj, K.; Slowikowski, A.; Haygreev, C.V. Deep learning architectures. In Deep learning: Concepts and Architectures; Springer: Berlin/Heidelberg, Germany, 2019; pp. 1–24. [Google Scholar]
- Yu, Y.; Si, X.; Hu, C.; Zhang, J. A review of recurrent neural networks: LSTM cells and network architectures. Neural Comput. 2019, 31, 1235–1270. [Google Scholar] [CrossRef] [PubMed]
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Prettenhofer, P.; Weiss, R.; Dubourg, V. Scikit-learn: Machine learning in Python. J. Mach. Learn. Res. 2011, 12, 2825–2830. [Google Scholar]
- Chollet, F. Keras: Deep Learning Library for Theano and Tensorflow. Available online: https//keras.io (accessed on 16 October 2021).
No. | Data Field | Purpose |
---|---|---|
1 | Soil Moisture | The historical collected soil moisture value will be used for retraining the proposed forecasting model. |
2 | Soil Temperature | The historical collected soil temperature value will be used to train/retrain the proposed model. And the real-time soil temperature value will be used to predict the future value of soil moisture. |
3 | Indoor: Air Temperature | The air indoor temperature indicates the air temperature inside the greenhouse. |
4 | Indoor: Relative Humidity | The indoor relative humidity indicates the air moisture inside the greenhouse that helps in making a decision for irrigation. |
5 | Indoor: Light Intensity | The indoor light intensity indicates the temperature and relative humidity inside the greenhouse. |
6 | Indoor: UV index | The UV index value impacts the temperature and relative humidity inside the greenhouse. |
7 | Outdoor: Air Temperature | The air outdoor temperature indicates the air temperature outside the greenhouse. |
8 | Outdoor: Relative Humidity | The outdoor relative humidity indicates the air moisture outside the greenhouse. |
9 | Outdoor: Light Intensity | The outdoor light intensity impacts the temperature and relative humidity outside the greenhouse. |
10 | Outdoor: UV index | The UV index value also impacts the temperature and relative humidity outside the greenhouse. |
11 | Outdoor: Wind Speed | The wind speed value indicates the speed of wind outside the greenhouse that may impact the wind flow inside the greenhouse. |
12 | Outdoor: Wind Direction | The wind direction indicates the direction of wind outside the greenhouse. |
13 | Outdoor: Precipitation Rate | The precipitation rate indicates the rate of rainfall at that time. |
14 | Outdoor: Precipitation Total | The precipitation total indicates the total amount of rainfall in one day. |
Date | Time | Indoor Data | Outdoor Data | Output | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Temp (°C) | Humid (%) | UV | lux | CO2 | Temp (°C) | Humid (%) | Wind Speed (mph) | Wind Gust (mph) | Air Pressure (in) | Precop. Rate (in) | Precip. Accum. (in) | UV | Solar (w/m2) | Soil Moisture (%) | ||
6/3/2020 | 9:05:30 | 28.11 | 37.81 | 0.36 | 63 | 599 | 31.39 | 36 | 0 | 0 | 29.88 | 0 | 0 | 0 | 0 | 63.1 |
6/3/2020 | 9:06:44 | 27.92 | 37.56 | 0.36 | 70 | 599 | 31.39 | 36 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 62.2 |
6/3/2020 | 9:11:45 | 27.3 | 35.38 | 0.36 | 10230 | 599 | 31.28 | 36 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 62.7 |
6/3/2020 | 9:19:16 | 28.38 | 70.19 | 0.07 | 1000 | 475 | 31.28 | 36 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 62.6 |
6/3/2020 | 9:24:16 | 32.81 | 55.13 | 1.87 | 35140 | 475 | 31.22 | 36 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 62.2 |
6/3/2020 | 9:29:17 | 34.41 | 52.34 | 3.78 | 54612 | 463 | 31.22 | 36 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 62.2 |
6/3/2020 | 9:34:17 | 34.65 | 48.95 | 4.14 | 54612 | 435 | 31.11 | 37 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 62.3 |
6/3/2020 | 9:44:19 | 35.64 | 45.96 | 4.46 | 54612 | 414 | 31.06 | 37 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 62 |
6/3/2020 | 9:49:20 | 34.79 | 50.78 | 1.3 | 17800 | 404 | 31 | 37 | 0 | 0 | 29.9 | 0 | 0 | 0 | 0 | 61.5 |
6/3/2020 | 9:54:20 | 35.54 | 46.95 | 1.91 | 30443 | 414 | 30.94 | 37 | 0 | 0 | 29.9 | 0 | 0 | 0 | 0 | 61.5 |
6/3/2020 | 9:59:21 | 35.16 | 48.93 | 1.31 | 23483 | 460 | 30.89 | 37 | 0 | 0 | 29.9 | 0 | 0 | 0 | 0 | 62.5 |
6/3/2020 | 10:04:21 | 35.52 | 47.37 | 1.19 | 14576 | 470 | 30.78 | 37 | 0 | 0 | 29.9 | 0 | 0 | 0 | 0 | 62.5 |
6/3/2020 | 10:09:22 | 35.93 | 46.12 | 1.33 | 17226 | 475 | 30.78 | 37 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 62.9 |
6/3/2020 | 10:14:22 | 36.13 | 46.72 | 1.67 | 32000 | 461 | 30.72 | 37 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 62.6 |
6/3/2020 | 10:19:23 | 36.38 | 45.48 | 2.53 | 31360 | 457 | 30.67 | 37 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 63 |
6/3/2020 | 10:24:23 | 36.67 | 45.08 | 2 | 24000 | 444 | 30.61 | 37 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 62.7 |
6/3/2020 | 10:29:24 | 36.45 | 46.15 | 1.43 | 16883 | 465 | 30.56 | 37 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 62.7 |
6/3/2020 | 10:34:24 | 36.54 | 47.52 | 1.61 | 21673 | 447 | 30.5 | 37 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 62.6 |
6/3/2020 | 10:39:25 | 36.28 | 45.84 | 2.41 | 29500 | 455 | 30.39 | 37 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 62.4 |
6/3/2020 | 10:44:25 | 36.36 | 46.36 | 2.4 | 37270 | 474 | 30.39 | 37 | 0 | 0 | 29.89 | 0 | 0 | 0 | 0 | 62.8 |
6/3/2020 | 10:49:26 | 36.51 | 46.17 | 2.87 | 29493 | 447 | 30.28 | 38 | 0 | 0 | 29.88 | 0 | 0 | 0 | 0 | 62.3 |
6/3/2020 | 10:54:26 | 37 | 46.31 | 3.83 | 48133 | 458 | 30.22 | 38 | 0 | 0 | 29.88 | 0 | 0 | 0 | 0 | 63.4 |
6/3/2020 | 10:59:27 | 37.05 | 45.83 | 2.07 | 30206 | 452 | 30.22 | 38 | 0 | 0 | 29.88 | 0 | 0 | 0 | 0 | 62.9 |
6/3/2020 | 11:04:28 | 36.73 | 46.13 | 3.59 | 43353 | 413 | 30.11 | 38 | 0 | 0 | 29.88 | 0 | 0 | 0 | 0 | 62.3 |
Variable | Mean | Standard Error | Median | Standard Deviation | Variance | Minimum | Maximum | Valid | Missing |
---|---|---|---|---|---|---|---|---|---|
Date | 44017.05313 | 0.140655674 | 44017 | 18.73890461 | 351.146546 | 43985 | 44049 | 17749 | 0 |
Time | 0.495631904 | 0.002184724 | 0.494050926 | 0.291060621 | 0.084716285 | 4.63E-05 | 0.999930556 | 17749 | 0 |
Indoor temp | 29.83309539 | 0.037799753 | 27.93 | 5.035886181 | 25.36014962 | 23.27 | 47.41 | 17749 | 0 |
Indoor humid | 75.64751197 | 0.144849823 | 79.96 | 19.29767169 | 372.4001327 | 25.64 | 100 | 17749 | 0 |
Indoor UV | 0.905835822 | 0.010987166 | 0.08 | 1.463769292 | 2.142620539 | 0 | 7.72 | 17749 | 0 |
Indoor lux | 11568.96558 | 130.4046691 | 933 | 17373.21068 | 301828449.3 | 0 | 54612 | 17749 | 0 |
CO2 indoor | 533.2625409 | 0.384002603 | 536 | 51.14880081 | 2616.199824 | 309 | 715 | 17749 | 0 |
Outdoor temp | 27.80067384 | 0.016361451 | 27.39 | 2.179760373 | 4.751355282 | 23.89 | 39.22 | 17742 | 7 |
Outdoor humid | 50.68223562 | 0.114157858 | 47 | 15.20872326 | 231.3052631 | 33 | 99 | 17749 | 0 |
Outdoor wind speed | 0.011347118 | 0.000578974 | 0 | 0.077134085 | 0.005949667 | 0 | 1.4 | 17749 | 0 |
Outdoor wind gust | 0.022722407 | 0.001031529 | 0 | 0.137425796 | 0.018885849 | 0 | 2.4 | 17749 | 0 |
Outdoor Pressure | 29.8581768 | 0.000524754 | 29.87 | 0.069910597 | 0.004887492 | 29.6 | 30.01 | 17749 | 0 |
Outdoor Precip. Rate | 0.0057068 | 0.000665134 | 0 | 0.088612771 | 0.007852223 | 0 | 3.78 | 17749 | 0 |
Outdoor Precip. Accum | 0.044142205 | 0.002202212 | 0 | 0.293390479 | 0.086077973 | 0 | 2.7 | 17749 | 0 |
Outdoor UV | 0.085356922 | 0.004644671 | 0 | 0.618788005 | 0.382898595 | 0 | 10 | 17749 | 0 |
Outdoor Solar | 11.27086596 | 0.527558327 | 0 | 70.28415491 | 4939.862431 | 0 | 1102.3 | 17749 | 0 |
Soil moisture | 56.21100907 | 0.020181385 | 56.1 | 2.688672606 | 7.22896038 | 50.7 | 87.9 | 17749 | 0 |
Indoor Temp | Indoor Humid | Indoor UV | Indoor lux | Indoor CO2 | Outdoor Temp | Outdoor Humid | Outdoor UV | Outdoor Solar | Soil Moisture | cos_Times | sin_Times | |
---|---|---|---|---|---|---|---|---|---|---|---|---|
0 | 28.11 | 37.81 | 0.36 | 63 | 599.0 | 31.39 | 36 | 0 | 0.0 | 63.1 | −0.723871 | 0.689935 |
1 | 27.92 | 37.56 | 0.36 | 70 | 599.0 | 31.39 | 36 | 0 | 0.0 | 62.2 | −0.727573 | 0.686030 |
2 | 27.30 | 35.38 | 0.36 | 10230 | 599.0 | 31.28 | 36 | 0 | 0.0 | 62.7 | −0.742414 | 0.669941 |
3 | 28.38 | 70.19 | 0.07 | 1000 | 475.0 | 31.28 | 36 | 0 | 0.0 | 62.6 | −0.763984 | 0.645235 |
4 | 32.81 | 55.13 | 1.87 | 35140 | 475.0 | 31.22 | 36 | 0 | 0.0 | 62.2 | −0.777878 | 0.628416 |
Hyperparameters | LR | SR | Epoch | Input Time Steps | Future Steps | Batch Size |
---|---|---|---|---|---|---|
Value | 0.01 | 80% Train 20% Test | 100 | 300 | 12 | 72 |
Value | 0.001 | 70% Train 30% Test | 100 | 300 | 12 | 72 |
Value | 0.0001 | 80% Train 20% Test | 100 | 300 | 12 | 72 |
Case | Learning Rate (LR) | Split Ratio (SR) | Case | Learning Rate (LR) | Split Ratio (SR) |
---|---|---|---|---|---|
1 | 0.1 | 70% (train), 30% (test) | 7 | 0.0001 | 70% (train), 30% (test) |
2 | 0.1 | 80% (train), 20% (test) | 8 | 0.0001 | 80% (train), 20% (test) |
3 | 0.01 | 70% (train), 30% (test) | 9 | 0.00001 | 70% (train), 30% (test) |
4 | 0.01 | 80% (train), 20% (test) | 10 | 0.00001 | 80% (train), 20% (test) |
5 | 0.001 | 70% (train), 30% (test) | 11 | 0.000001 | 70% (train), 30% (test) |
6 | 0.001 | 80% (train), 20% (test) | 12 | 0.000001 | 80% (train), 20% (test) |
Time Interval | Time Steps | Soil Moisture Value (%) | RSME Validation (%) | ||
---|---|---|---|---|---|
Measure | Forecast | Static Error | |||
12 h | 144 | 57.80 | 55.70 | 2.10 | 2.595 |
8 h | 96 | 57.00 | 54.90 | 2.10 | 2.466 |
6 h | 72 | 56.20 | 54.50 | 1.70 | 2.380 |
4 h | 48 | 55.90 | 54.70 | 1.20 | 2.216 |
3 h | 36 | 54.90 | 54.70 | 0.20 | 2.096 |
2 h | 24 | 55.70 | 55.85 | 0.15 | 2.009 |
1 h | 12 | 55.40 | 54.53 | 0.13 | 1.779 |
30 min | 6 | 55.70 | 55.65 | 0.05 | 1.637 |
Next 1 h (LSTM) | Next 30 min (Bidirectional LSTM) | |
---|---|---|
1. Soil moisture value: Measure | 55.64% | 55.70% |
2. Soil moisture value: Forecast | 55.70% | 55.55% |
3. Cross Validation (CV) results | ||
3.1. Round 1 | ||
-RSME loss | 0.62% | 0.66% |
-CV loss | 0.38% | 0.42% |
3.2. Round 2 | ||
-RSME loss | 0.75% | 0.79% |
-CV loss | 0.56% | 0.60% |
3.3. Round 3 | ||
-RSME loss | 0.78% | 0.82% |
-CV loss | 0.61% | 0.65% |
3.4. Round 4 | ||
-RSME loss | 0.77% | 0.81% |
-CV loss | 0.60% | 0.66% |
3.5. Round 5 | ||
-RSME loss | 0.69% | 0.73% |
-CV loss | 0.48% | 0.54% |
3.6. Averaged overall error estimation | ||
-RSME loss | 0.72% (+/−0,06%) | 0.76% (+/−0,06%) |
-CV loss | 0.52% (+/−0,08%) | 0.57% (+/−0,08%) |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Suebsombut, P.; Sekhari, A.; Sureephong, P.; Belhi, A.; Bouras, A. Field Data Forecasting Using LSTM and Bi-LSTM Approaches. Appl. Sci. 2021, 11, 11820. https://doi.org/10.3390/app112411820
Suebsombut P, Sekhari A, Sureephong P, Belhi A, Bouras A. Field Data Forecasting Using LSTM and Bi-LSTM Approaches. Applied Sciences. 2021; 11(24):11820. https://doi.org/10.3390/app112411820
Chicago/Turabian StyleSuebsombut, Paweena, Aicha Sekhari, Pradorn Sureephong, Abdelhak Belhi, and Abdelaziz Bouras. 2021. "Field Data Forecasting Using LSTM and Bi-LSTM Approaches" Applied Sciences 11, no. 24: 11820. https://doi.org/10.3390/app112411820
APA StyleSuebsombut, P., Sekhari, A., Sureephong, P., Belhi, A., & Bouras, A. (2021). Field Data Forecasting Using LSTM and Bi-LSTM Approaches. Applied Sciences, 11(24), 11820. https://doi.org/10.3390/app112411820