# Field Data Forecasting Using LSTM and Bi-LSTM Approaches
## 4 Conclusions and Future Works  
Water management for crop production is a difficult subject with implications for water sustainability. However, managing this resource is costly, requiring the use of numerous hardware tools, such as soil sensors, to effectively manage crop irrigation. In this paper, we proposed a novel method for estimating soil moisture in the context of crop production water management. We use machine learning to forecast soil moisture in the future using the output of low-cost IoT sensors. We propose a soil moisture forecasting model with Long-Short Term Memory based on our deep learning approach (LSTM). The data we use to train and validate our model were collected on a testbed in the Thai province of Chiang Mai. An array of IoT sensors, including a soil sensor, a water sensor, an air sensor, and a weather station, is used to collect data. An extensive data preprocessing step is performed to clean the collected data. The LSTM model we propose uses environmental indicators to predict future soil moisture based on farm environmental data. Our model was extensively tuned, and we tested various setups and architectures. In the future, more datasets will be used to estimate the performance of our models. In addition, we will put our model through its paces in various locations to see how well it performs. The data we used are available at [[https://github.com/SFDataset/DataSet.git](https://github.com/SFDataset/DataSet.git)]([https://github.com/SFDataset/DataSet.git](https://github.com/SFDataset/DataSet.git)) (accessed on 6 December 2021) (see an Appendix A).  
\begin{table}
\begin{tabular}{l c c} \hline \hline  & **Next 1 h** & **Next 30 min** \\  & **(LSTM)** & **(Bidirectional LSTM)** \\ \hline
1. Soil moisture value: Measure & 55.64\% & 55.70\% \\ \hline
2. Soil moisture value: Forecast & 55.70\% & 55.55\% \\ \hline
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\%) \\ \hline \hline \end{tabular}
\end{table}
Table 8: Comparison of cross-validation result of soil moisture forecasting model (LSTM and Bi-LSTM).  
**Author Contributions:** Conceptualization, P.S. ([PERSON]); Data curation, P.S. ([PERSON]) and A.B. ([PERSON]); Funding acquisition, A.S. and A.B. ([PERSON]); Investigation, A.S.; Methodology, P.S. ([PERSON]) and A.S.; Software, A.B. ([PERSON]); Supervision, A.S., [PERSON] ([PERSON]) and [PERSON] ([PERSON]); Writing--original draft, [PERSON] ([PERSON]); Writing--review & editing, [PERSON] ([PERSON]) and [PERSON] ([PERSON]). All authors have read and agreed to the published version of the manuscript.  
**Data Availability Statement:** The dataset presented in this paper is available at: [[https://github.com/SFDataset/DataSet.git](https://github.com/SFDataset/DataSet.git)]([https://github.com/SFDataset/DataSet.git](https://github.com/SFDataset/DataSet.git)).  
**Acknowledgments:** The authors would like to express their gratitude to DISP laboratory and SUN-SpACe project 598748-EPP-1-2018-1-FR-EPPKA2-CBHE-JP (2018-3228/001-001), and acknowledge the support of Universite Lumiere Lyon 2 (France), Chiang Mai University--College of Arts Media and Technology (Thailand), and Qatar University. This publication was also made possible by NPRP Grant No. NPRP11S-1227-170135 from the Qatar National Research Fund (a member of Qatar Foundation), Qatar.  
**Conflicts of Interest:** The authors declare no conflict of interest.