Evaluating Time-Series Prediction of Temperature, Relative Humidity, and CO2 in the Greenhouse with Transformer-Based and RNN-Based Models
Abstract
:1. Introduction
2. Materials and Methods
2.1. Data Acquisition and Preprocessing
2.2. Transformer-Based Model: Autoformer
2.3. RNN-Based Model: (1) Long Short-Term Memory (LSTM)
2.4. RNN-Based Model: (2) Segment RNN (SegRNN)
2.5. Linear-Based Model: DLinear
2.6. Impliementation Details and Model Evaluation
3. Results
4. Discussion
5. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Grange, R.I.; Hand, D.W. A Review of the Effects of Atmospheric Humidity on the Growth of Horticultural Crops. J. Hortic. Sci. 1987, 62, 125–134. [Google Scholar] [CrossRef]
- Van Der Ploeg, A.; Heuvelink, E. Influence of Sub-Optimal Temperature on Tomato Growth and Yield: A Review. J. Hortic. Sci. Biotechnol. 2005, 80, 652–659. [Google Scholar] [CrossRef]
- Ohtaka, K.; Yoshida, A.; Kakei, Y.; Fukui, K.; Kojima, M.; Takebayashi, Y.; Yano, K.; Imanishi, S.; Sakakibara, H. Difference between Day and Night Temperatures Affects Stem Elongation in Tomato (Solanum lycopersicum) Seedlings via Regulation of Gibberellin and Auxin Synthesis. Front. Plant Sci. 2020, 11, 1947. [Google Scholar] [CrossRef] [PubMed]
- Fitz-Rodríguez, E.; Kubota, C.; Giacomelli, G.A.; Tignor, M.E.; Wilson, S.B.; McMahon, M. Dynamic Modeling and Simulation of Greenhouse Environments under Several Scenarios: A Web-Based Application. Comput. Electron. Agric. 2010, 70, 105–116. [Google Scholar] [CrossRef]
- Kamilaris, A.; Kartakoullis, A.; Prenafeta-Boldú, F.X. A Review on the Practice of Big Data Analysis in Agriculture. Comput. Electron. Agric. 2017, 143, 23–37. [Google Scholar] [CrossRef]
- Moon, T.W.; Jung, D.H.; Chang, S.H.; Son, J.E. Estimation of Greenhouse CO2 Concentration via an Artificial Neural Network That Uses Environmental Factors. Hortic. Environ. Biotechnol. 2018, 59, 45–50. [Google Scholar] [CrossRef]
- Moon, T.; Choi, H.Y.; Jung, D.H.; Chang, S.H.; Son, J.E. Prediction of CO2 Concentration via Long Short-Term Memory Using Environmental Factors in Greenhouses. Korean J. Hortic. Sci. Technol. 2020, 38, 201–209. [Google Scholar] [CrossRef]
- Cao, Q.; Wu, Y.; Yang, J.; Yin, J. Greenhouse Temperature Prediction Based on Time-Series Features and LightGBM. Appl. Sci. 2023, 13, 1610. [Google Scholar] [CrossRef]
- Choi, H.; Moon, T.; Jung, D.H.; Son, J.E. Prediction of Air Temperature and Relative Humidity in Greenhouse via a Multilayer Perceptron Using Environmental Factors. J. Bio-Environ. Control 2019, 28, 95–103. [Google Scholar] [CrossRef]
- Jung, D.H.; Kim, H.S.; Jhin, C.; Kim, H.J.; Park, S.H. Time-Serial Analysis of Deep Neural Network Models for Prediction of Climatic Conditions inside a Greenhouse. Comput. Electron. Agric. 2020, 173, 105402. [Google Scholar] [CrossRef]
- Ullah, I.; Fayaz, M.; Naveed, N.; Kim, D. ANN Based Learning to Kalman Filter Algorithm for Indoor Environment Prediction in Smart Greenhouse. IEEE Access 2020, 8, 159371–159388. [Google Scholar] [CrossRef]
- Cai, W.; Wei, R.; Xu, L.; Ding, X. A Method for Modelling Greenhouse Temperature Using Gradient Boost Decision Tree. Inf. Process. Agric. 2022, 9, 343–354. [Google Scholar] [CrossRef]
- Jung, D.-H.; Lee, T.S.; Kim, K.; Park, S.H. A Deep Learning Model to Predict Evapotranspiration and Relative Humidity for Moisture Control in Tomato Greenhouses. Agronomy 2022, 12, 2169. [Google Scholar] [CrossRef]
- Wolf, T.; Debut, L.; Sanh, V.; Chaumond, J.; Delangue, C.; Moi, A.; Cistac, P.; Rault, T.; Louf, R.; Funtowicz, M.; et al. Transformers: State-of-the-Art Natural Language Processing. In Proceedings of the 2020 Conference on Empirical Methods in Natural Language Processing: System Demonstrations, Online, 16–20 November 2020; pp. 38–45. [Google Scholar] [CrossRef]
- Dong, L.; Xu, S.; Xu, B. Speech-Transformer: A No-Recurrence Sequence-to-Sequence Model for Speech Recognition. In Proceedings of the 2018 IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), Calgary, AB, Canada, 15–20 April 2018; pp. 5884–5888. [Google Scholar] [CrossRef]
- Khan, S.; Naseer, M.; Hayat, M.; Zamir, S.W.; Khan, F.S.; Shah, M. Transformers in Vision: A Survey. ACM Comput. Surv. (CSUR) 2022, 54, 1–41. [Google Scholar] [CrossRef]
- Han, X.; Zhang, Z.; Ding, N.; Gu, Y.; Liu, X.; Huo, Y.; Qiu, J.; Yao, Y.; Zhang, A.; Zhang, L.; et al. Pre-Trained Models: Past, Present and Future. AI Open 2021, 2, 225–250. [Google Scholar] [CrossRef]
- Li, G.; Jiao, L.; Chen, P.; Liu, K.; Wang, R.; Dong, S.; Kang, C. Spatial Convolutional Self-Attention-Based Transformer Module for Strawberry Disease Identification under Complex Background. Comput. Electron. Agric. 2023, 212, 108121. [Google Scholar] [CrossRef]
- Woo, G.; Liu, C.; Sahoo, D.; Kumar, A.; Hoi, S. ETSformer: Exponential Smoothing Transformers for Time-Series Forecasting. arXiv 2022, arXiv:2202.01381. [Google Scholar]
- Wen, Q.; Zhou, T.; Zhang, C.; Chen, W.; Ma, Z.; Yan, J.; Sun, L. Transformers in Time Series: A Survey. In Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence (IJCAI-23), Macao, China, 19–25 August 2023; pp. 6778–6786. [Google Scholar] [CrossRef]
- Zeng, A.; Chen, M.; Zhang, L.; Xu, Q. Are Transformers Effective for Time Series Forecasting? arXiv 2022, arXiv:2205.13504v2. [Google Scholar] [CrossRef]
- Lim, B.; Zohren, S. Time-Series Forecasting with Deep Learning: A Survey. Philos. Trans. R. Soc. A 2021, 379, 20200209. [Google Scholar] [CrossRef]
- Wu, H.; Xu, J.; Wang, J.; Long, M. Autoformer: Decomposition Transformers with Auto-Correlation for Long-Term Series Forecasting. Adv. Neural Inf. Process Syst. 2021, 34, 22419–22430. [Google Scholar]
- Hochreiter, S.; Schmidhuber, J. Long Short-Term Memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef]
- Lin, S.; Lin, W.; Wu, W.; Zhao, F.; Mo, R.; Zhang, H. SegRNN: Segment Recurrent Neural Network for Long-Term Time Series Forecasting. arXiv 2023, arXiv:2308.11200. [Google Scholar]
- Brown, T.B.; Mann, B.; Ryder, N.; Subbiah, M.; Kaplan, J.; Dhariwal, P.; Neelakantan, A.; Shyam, P.; Sastry, G.; Askell, A.; et al. Language Models Are Few-Shot Learners. Adv. Neural Inf. Process Syst. 2020, 33, 1877–1901. [Google Scholar]
- Huang, Z.; Wang, X.; Huang, L.; Huang, C.; Wei, Y.; Liu, W. CCNet: Criss-Cross Attention for Semantic Segmentation. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Seoul, Republic of Korea, 27 October–2 November 2019; pp. 603–612. [Google Scholar]
- Carion, N.; Massa, F.; Synnaeve, G.; Usunier, N.; Kirillov, A.; Zagoruyko, S. End-to-End Object Detection with Transformers. In Proceedings of the European Conference on Computer Vision, Glasgow, UK, 23–28 August 2020; Volume 12346, pp. 213–229. [Google Scholar]
- Chen, C.-F.; Fan, Q.; Panda, R. CrossViT: Cross-Attention Multi-Scale Vision Transformer for Image Classification. In Proceedings of the IEEE/CVF International Conference on Computer Vision, Montreal, BC, Canada, 11–17 October 2021; pp. 357–366. [Google Scholar]
- Das, A.; Research, G.; Kong, W.; Leach, A.; Cloud, G.; Mathur, S.; Sen, R.; Yu, R. Long-Term Forecasting with TiDE: Time-Series Dense Encoder. arXiv 2023, arXiv:2304.08424. [Google Scholar]
- Waheeb, W.; Ghazali, R. A Novel Error-Output Recurrent Neural Network Model for Time Series Forecasting. Neural Comput. Appl. 2020, 32, 9621–9647. [Google Scholar] [CrossRef]
- Liu, Y.; Gong, C.; Yang, L.; Chen, Y. DSTP-RNN: A Dual-Stage Two-Phase Attention-Based Recurrent Neural Network for Long-Term and Multivariate Time Series Prediction. Expert. Syst. Appl. 2020, 143, 113082. [Google Scholar] [CrossRef]
- Torres, J.F.; Hadjout, D.; Sebaa, A.; Martínez-Álvarez, F.; Troncoso, A. Deep Learning for Time Series Forecasting: A Survey. Big Data 2021, 9, 3–21. [Google Scholar] [CrossRef] [PubMed]
- Madan, R.; Sarathimangipudi, P. Predicting Computer Network Traffic: A Time Series Forecasting Approach Using DWT, ARIMA and RNN. In Proceedings of the 2018 Eleventh International Conference on Contemporary Computing (IC3), Noida, India, 2–4 August 2018. [Google Scholar] [CrossRef]
- Hewamalage, H.; Bergmeir, C.; Bandara, K. Recurrent Neural Networks for Time Series Forecasting: Current Status and Future Directions. Int. J. Forecast. 2021, 37, 388–427. [Google Scholar] [CrossRef]
- Abdel-Nasser, M.; Mahmoud, K. Accurate Photovoltaic Power Forecasting Models Using Deep LSTM-RNN. Neural Comput. Appl. 2017, 31, 2727–2740. [Google Scholar] [CrossRef]
- Wu, Y.X.; Wu, Q.B.; Zhu, J.Q. Improved EEMD-Based Crude Oil Price Forecasting Using LSTM Networks. Phys. A Stat. Mech. Its Appl. 2019, 516, 114–124. [Google Scholar] [CrossRef]
- Peng, M.; Motagh, M.; Lu, Z.; Xia, Z.; Guo, Z.; Zhao, C.; Liu, Q. Characterization and Prediction of InSAR-Derived Ground Motion with ICA-Assisted LSTM Model. Remote Sens. Env. 2024, 301, 113923. [Google Scholar] [CrossRef]
- Sagheer, A.; Kotb, M. Time Series Forecasting of Petroleum Production Using Deep LSTM Recurrent Networks. Neurocomputing 2019, 323, 203–213. [Google Scholar] [CrossRef]
- Duan, Y.; Lv, Y.; Wang, F.Y. Travel Time Prediction with LSTM Neural Network. In Proceedings of the 2016 IEEE 19th International Conference on Intelligent Transportation Systems (ITSC), Rio de Janeiro, Brazil, 1–4 November 2016; pp. 1053–1058. [Google Scholar] [CrossRef]
- Chimmula, V.K.R.; Zhang, L. Time Series Forecasting of COVID-19 Transmission in Canada Using LSTM Networks. Chaos Solitons Fractals 2020, 135, 109864. [Google Scholar] [CrossRef]
- De Gooijer, J.G.; Hyndman, R.J. 25 Years of Time Series Forecasting. Int. J. Forecast. 2006, 22, 443–473. [Google Scholar] [CrossRef]
- Nifa, K.; Boudhar, A.; Ouatiki, H.; Elyoussfi, H.; Bargam, B.; Chehbouni, A. Deep Learning Approach with LSTM for Daily Streamflow Prediction in a Semi-Arid Area: A Case Study of Oum Er-Rbia River Basin, Morocco. Water 2023, 15, 262. [Google Scholar] [CrossRef]
- Ahn, J.Y. Performance Evaluation of Deep Learning Algorithms for Forecasting Greenhouse Environment and Crop Growth Using Time Series Data. Master’s Thesis, Sejong University, Seoul, Republic of Korea, 2023. [Google Scholar]
- Lin, S.; Lin, W.; Wu, W.; Wang, S.; Wang, Y. PETformer: Long-Term Time Series Forecasting via Placeholder-Enhanced Transformer. arXiv 2023, arXiv:2308.04791. [Google Scholar]
- Lam, A.Y.S.; Geng, Y.; Frohmann, M.; Karner, M.; Khudoyan, S.; Wagner, R.; Schedl, M. Predicting the Price of Bitcoin Using Sentiment-Enriched Time Series Forecasting. Big Data Cogn. Comput. 2023, 7, 137. [Google Scholar] [CrossRef]
- Benidis, K.; Rangapuram, S.S.; Flunkert, V.; Wang, Y.; Maddix, D.; Turkmen, C.; Gasthaus, J.; Bohlke-Schneider, M.; Salinas, D.; Stella, L.; et al. Deep Learning for Time Series Forecasting: Tutorial and Literature Survey. ACM Comput. Surv. 2022, 55, 1–36. [Google Scholar] [CrossRef]
- Linardatos, P.; Papastefanopoulos, V.; Panagiotakopoulos, T.; Kotsiantis, S. CO2 Concentration Forecasting in Smart Cities Using a Hybrid ARIMA–TFT Model on Multivariate Time Series IoT Data. Sci. Rep. 2023, 13, 17266. [Google Scholar] [CrossRef] [PubMed]
- Mohmed, G.; Heynes, X.; Naser, A.; Sun, W.; Hardy, K.; Grundy, S.; Lu, C. Modelling Daily Plant Growth Response to Environmental Conditions in Chinese Solar Greenhouse Using Bayesian Neural Network. Sci. Rep. 2023, 13, 4379. [Google Scholar] [CrossRef]
Input Variables (Unit) | Description |
---|---|
Environmental values | |
Outside temperature (°C) | Temperature acquired from an external weather station |
Outside relative humidity (%) | Relative humidity acquired from an external weather station |
Outside wind direction (°) | Wind direction acquired from an external weather station |
Outside wind velocity (m·s−1) | Wind speed acquired from an external weather station |
Temperature (°C) | Air temperature acquired from an internal sensor module |
Relative humidity (%) | Relative humidity acquired from an internal sensor module |
CO2 concentration (ppm) | Carbon dioxide concentration acquired from an internal sensor module |
Actuator values | |
Fan (on/off) | Circulating fan status |
Fogging (on/off) | Fogging valve status |
CO2 injection (on/off) | CO2 injection valve status |
Window openness (%) | Lee-side window opening ratio |
Shade curtain (%) | Shading curtain opening ratio |
Heat retention curtain (%) | Heat retention curtain opening ratio |
Input Variables (Unit) | Range |
---|---|
Environmental values | |
Outside temperature (°C) | −16.3–29.9 |
Outside relative humidity (%) | 1–100 |
Outside wind direction (°) | 0–355 |
Outside wind velocity (m·s−1) | 0–0.5 |
Temperature (°C) | 8.4–36.9 |
Relative humidity (%) | 27.3–94.1 |
CO2 concentration (ppm) | 359–582 |
Actuator values | |
Fan (on/off) | 0 or 1 |
Fogging (on/off) | 0 or 1 |
CO2 injection (on/off) | 0 or 1 |
Window openness (%) | 0–12.5 |
Shade curtain (%) | 0–100 |
Heat retention curtain (%) | 0–100 |
Autoformer | DLinear | LSTM | SegRNN | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Temperature | RH | CO2 | Temperature | RH | CO2 | Temperature | RH | CO2 | Temperature | RH | CO2 | |
MAE | 0.449 | 0.524 | 0.510 | 0.189 | 0.273 | 0.191 | 0.469 | 0.603 | 0.610 | 0.192 | 0.253 | 0.231 |
MSE | 0.353 | 0.466 | 0.452 | 0.085 | 0.183 | 0.092 | 0.357 | 0.622 | 0.712 | 0.089 | 0.201 | 0.137 |
RMSE | 0.594 | 0.683 | 0.672 | 0.293 | 0.427 | 0.304 | 0.597 | 0.776 | 0.844 | 0.299 | 0.449 | 0.371 |
R2 | 0.744 | 0.636 | 0.590 | 0.938 | 0.857 | 0.783 | 0.645 | 0.404 | 0.289 | 0.935 | 0.843 | 0.875 |
Autoformer | DLinear | LSTM | SegRNN | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Temperature | RH | CO2 | Temperature | RH | CO2 | Temperature | RH | CO2 | Temperature | RH | CO2 | |
MAE | 0.608 | 0.695 | 0.566 | 0.312 | 0.458 | 0.279 | 0.580 | 0.684 | 0.671 | 0.343 | 0.477 | 0.354 |
MSE | 0.614 | 0.754 | 0.562 | 0.229 | 0.410 | 0.178 | 0.557 | 0.755 | 0.823 | 0.298 | 0.477 | 0.305 |
RMSE | 0.783 | 0.868 | 0.745 | 0.479 | 0.640 | 0.422 | 0.746 | 0.869 | 0.907 | 0.545 | 0.690 | 0.552 |
R2 | 0.554 | 0.411 | 0.488 | 0.833 | 0.680 | 0.580 | 0.447 | 0.253 | 0.178 | 0.786 | 0.628 | 0.711 |
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2024 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
Ahn, J.Y.; Kim, Y.; Park, H.; Park, S.H.; Suh, H.K. Evaluating Time-Series Prediction of Temperature, Relative Humidity, and CO2 in the Greenhouse with Transformer-Based and RNN-Based Models. Agronomy 2024, 14, 417. https://doi.org/10.3390/agronomy14030417
Ahn JY, Kim Y, Park H, Park SH, Suh HK. Evaluating Time-Series Prediction of Temperature, Relative Humidity, and CO2 in the Greenhouse with Transformer-Based and RNN-Based Models. Agronomy. 2024; 14(3):417. https://doi.org/10.3390/agronomy14030417
Chicago/Turabian StyleAhn, Ju Yeon, Yoel Kim, Hyeonji Park, Soo Hyun Park, and Hyun Kwon Suh. 2024. "Evaluating Time-Series Prediction of Temperature, Relative Humidity, and CO2 in the Greenhouse with Transformer-Based and RNN-Based Models" Agronomy 14, no. 3: 417. https://doi.org/10.3390/agronomy14030417
APA StyleAhn, J. Y., Kim, Y., Park, H., Park, S. H., & Suh, H. K. (2024). Evaluating Time-Series Prediction of Temperature, Relative Humidity, and CO2 in the Greenhouse with Transformer-Based and RNN-Based Models. Agronomy, 14(3), 417. https://doi.org/10.3390/agronomy14030417