A framework for predicting greenhouse microclimate in tomato production using XGBoost, LSTM and random forest
Abstract
Global food insecurity remains acute, affecting 28% of the world’s population in 2025. In response, greenhouse production can raise food productivity by enabling microclimate control, longer production cycles, and more efficient water and nutrient use. We instrumented a globe-type tomato greenhouse in Duitama, Colombia, with an environmental monitoring system that records soil temperature, air temperature, and relative humidity. Building on 21 months of data, we propose an end-to-end forecasting framework with two stages: (i) data preprocessing—removing duplicates and nonphysical records, controlling outliers, resampling to an hourly grid, imputing gaps, and applying min-max scaling; and (ii) modeling—where we systematically tune three AI paradigms: an XGBoost regressor with explicit temporal descriptors to encode short-term memory and local trends; an attention-enhanced encoder-decoder LSTM for multi-step forecasting; and a Random Forest ensemble with a dedicated regressor for each target variable. Empirical results show that XGBoost consistently outperforms RF and LSTM, achieving R $$^{\varvec{2}}$$ values up to 0.9509 and the lowest RMSE, MAE, and MAPE—reducing average error by roughly 61% relative to the next-best RF model. Moreover, compared with recent state-of-the-art methods, XGBoost offers the most balanced trade-off between accuracy and forecast horizon, enabling growers to make proactive, data-driven decisions that result in higher-quality yields.
Fields of Study & Subjects
Greenhouse Technology and Climate Control
Plant Water Relations and Carbon Dynamics
Hydrological Forecasting Using AI
Publication details
- Journal / source
- Theoretical and Applied Climatology
- Publisher
- Springer Science and Business Media LLC
- Volume
- 157
- Issue
- 6
- Publication date
- 30 April 2026
- Language
- EN