Next Article in Journal
Cross-Layer Protocol Design and Performance Evaluation of LoRa Ad Hoc Networks for Heterogeneous Traffic
Previous Article in Journal
Acoustic Vector Sensor-Based UAV Sound Source Localization via Covariance Enhancement and Confidence Guidance Tracking
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Strict Recursive Closed-Loop Evaluation of Greenhouse Air Temperature Forecasting with Generated Exogenous Variables and Exogenous-Error Propagation Analysis

1
College of Mechanical and Electrical Engineering, Tarim University, Alar 843300, China
2
Xinjiang Production and Construction Corps (XPCC), Key Laboratory of Utilization and Equipment of Special Agricultural and Forestry Products in Southern Xinjiang, Alar 843300, China
3
Modern Agricultural Engineering Key Laboratory at Universities of Education Department of Xinjiang Uygur Autonomous Region, Alar 843300, China
*
Authors to whom correspondence should be addressed.
Sensors 2026, 26(15), 4717; https://doi.org/10.3390/s26154717
Submission received: 25 June 2026 / Revised: 13 July 2026 / Accepted: 23 July 2026 / Published: 24 July 2026
(This article belongs to the Section Environmental Sensing)

Abstract

Accurate multi-horizon forecasting of greenhouse air temperature is essential for sensor-based environmental monitoring and control-oriented decision support. However, conventional evaluation methods often rely on open-loop or semi-closed-loop settings, where future observations may be unavailable during practical deployment. This study established a strict recursive closed-loop forecasting protocol and an exogenous-error propagation analysis framework using multi-source environmental sensing data. A Liquid Neural Network (LNN) was developed as a continuous-time forecasting model and compared with long short-term memory (LSTM), gated recurrent unit (GRU), and extreme gradient boosting (XGBoost) under consistent data conditions. During inference, future greenhouse air temperature and exogenous variables were not observed but recursively generated through predicted-temperature feedback and exogenous-variable forecasting. Across 10 repeated runs, the LNN achieved the lowest one-step prediction error, with a mean absolute error of 0.4771 °C and root mean square error of 0.5996 °C. However, under strict recursive closed-loop forecasting, LSTM showed the lowest errors at 6 h, 24 h, and 48 h horizons, indicating stronger long-horizon stability. Ablation experiments demonstrated that using observed future exogenous variables underestimated forecasting errors, while exogenous-error analysis identified outdoor temperature and solar radiation as the dominant sources of propagated uncertainty. These results highlight the importance of evaluating greenhouse air temperature forecasting under realistic recursive conditions by considering both model stability and future input uncertainty.

1. Introduction

Greenhouse air temperature is a key state variable in environmental regulation for protected cultivation. It directly affects crop photosynthesis, transpiration, nutrient uptake, flower and fruit development, and disease risk [1]. With advances in Internet of Things (IoT) sensors, wireless communication, and environmental monitoring platforms, indoor and outdoor air temperature and humidity, solar radiation, wind speed, soil moisture, and CO2 concentration can be continuously collected in greenhouses, forming high-temporal-resolution multi-source environmental sensing data. These data provide an important basis for greenhouse air temperature forecasting, environmental state monitoring, and intelligent regulation. Unlike open-field environments, greenhouse air temperature is not simply determined by external meteorological conditions, but is jointly affected by solar radiation, heat transfer through covering materials, ventilation heat exchange, heat storage and release by soil and walls, crop canopy transpiration, and production management practices [2]. Therefore, greenhouse air temperature forecasting models should not only characterize the thermal state of the greenhouse using multi-source sensing data, but also provide continuous temperature trajectories over future decision windows ranging from several hours to several days [3,4]. Such forecasts are practically valuable because greenhouse control actions, including ventilation, shading, auxiliary heating, and other environmental regulation measures, often require lead time and are affected by facility thermal inertia. Reliable multi-horizon temperature trajectories can therefore support early warning of high- or low-temperature risks, anticipatory environmental regulation, and model predictive control, rather than relying only on delayed threshold-based responses.
More broadly, data-driven modelling has become an important methodological basis for digital agriculture and precision-farming control. Statistical learning, data mining, predictive modelling, and machine-learning approaches can transform historical sensing data into predictions and decision-support information for optimized agricultural management [5]. Recent reviews have further emphasized that the integration of machine learning, optimization techniques, cyber–physical systems, information and communication technologies, and control theory is reshaping agricultural system modelling by improving decision-making, resource-use efficiency, and sustainability [6]. These developments provide a general background for using multi-source sensing data and recursive forecasting models to support greenhouse environmental prediction and control-oriented decision-making.
Data-driven methods have been widely used for greenhouse microclimate forecasting. Early studies demonstrated that neural networks can characterize nonlinear relationships among greenhouse environmental variables and can be used for greenhouse air temperature prediction [7,8]. In recent years, with the accumulation of greenhouse IoT monitoring data, machine-learning and deep-learning models have been applied to multi-parameter forecasting tasks involving greenhouse temperature, humidity, CO2 concentration, solar radiation, and soil environmental variables [9,10,11]. Francik and Kurpaska constructed an artificial neural network (ANN) model based on facility environmental monitoring data to forecast air temperature changes inside a heated foil tunnel, showing that neural-network models based on indoor and outdoor environmental sensing variables can support facility microclimate prediction and environmental management [12]. Codeluppi et al. further investigated greenhouse indoor air temperature forecasting from the perspective of edge deployment by combining IoT monitoring data with embedded artificial intelligence models [13]. These studies indicate that sensor-data-driven greenhouse forecasting has extended from environmental monitoring itself to predictive modelling, edge deployment, and control-oriented decision support. For multi-horizon forecasting, attention-based LSTM models, Transformer/recurrent neural network (RNN) comparison studies, and gated recurrent unit (GRU) models based on external weather data have shown that deep sequence models can capture historical dependence and nonlinear variation trends in greenhouse environmental variables [14,15,16]. However, most existing studies still focus on offline prediction accuracy, while recursive stability under online deployment, the unavailability of future sensor observations, and long-horizon error accumulation remain insufficiently investigated.
Existing greenhouse air temperature forecasting studies still show a mismatch between evaluation protocols and practical application scenarios. Many studies adopt one-step prediction or open-loop multi-step prediction, in which observed sequences are used to update the input window when forecasting future states, or future exogenous variables such as outdoor meteorological variables, solar radiation, and humidity are assumed to be directly available. In practical online applications, however, the model can access only historical sensor observations collected before the forecast origin. As rolling forecasting proceeds, future greenhouse air temperature cannot be provided in advance by sensors and must be obtained through model prediction and feedback, while future driving variables must be supplied by weather forecasts, exogenous-variable generators, or other estimation methods. For related sensor-estimation tasks, Guesbaya et al. constructed an LSTM-RNN-based soft sensor for greenhouse vent opening estimation using indoor and outdoor greenhouse climate sensing variables, indicating that sensor-data-based models can be used not only for environmental variable prediction but also for indirect estimation of unobserved states [17]. Soft-sensor studies have also shown that the integration of hardware sensing data and computational models can estimate variables that are difficult to directly measure or obtain in real time, thereby improving biosystem monitoring and control capability [18]. Therefore, in multi-horizon greenhouse air temperature forecasting, using observed future temperature or observed future exogenous sensor variables during evaluation may underestimate long-horizon prediction errors and overestimate model deployability. Multi-step time-series forecasting studies have shown that direct, recursive, and multi-output strategies have different error propagation mechanisms [19], while sequence-generation studies have indicated that relying on observed inputs during training but model-generated outputs during inference can induce training–inference mismatch and error accumulation [20]. Thus, online-deployment-oriented evaluation of greenhouse air temperature forecasting should simultaneously consider predicted-temperature feedback and uncertainty in future exogenous sensor variables [21,22,23].
From the perspective of greenhouse thermal dynamics, air temperature exhibits continuous evolution, multiple time scales, and strong exogenous forcing. Solar radiation, ventilation disturbances, and changes in outdoor temperature and humidity can induce short-term temperature fluctuations, whereas walls, soil, covering materials, and crop canopies introduce thermal inertia and delayed responses. LSTM, GRU, and extreme gradient boosting (XGBoost) have been widely used for time-series modelling and nonlinear prediction tasks [24,25,26], but their error accumulation characteristics under strict recursive closed-loop conditions still require further comparison. In recent years, continuous-time neural networks, including neural ordinary differential equations, latent ODEs, liquid time-constant networks, and neural controlled differential equations, have provided new methodological foundations for modelling dynamic state evolution [27,28,29,30]. Liquid Neural Networks (LNNs), as a class of continuous-time recurrent neural models, describe system dynamic responses through learnable time constants and continuous state updates. These properties make LNNs a suitable continuous-time candidate model for examining greenhouse air temperature forecasting under recursive conditions, because greenhouse temperature sequences are characterized by coexisting fast and slow processes, thermal inertia, and strong exogenous forcing. However, whether such short-term dynamic fitting ability can be maintained during long-horizon recursive forecasting remains uncertain when predicted-temperature feedback, generated exogenous variables, and error accumulation are simultaneously involved.
To address these issues, this study established a strict recursive closed-loop forecasting protocol and an exogenous-error propagation analysis framework for greenhouse air temperature prediction using multi-source environmental sensing data. Within this framework, an LNN model was constructed as a continuous-time forecasting model to evaluate the feasibility of recursive closed-loop prediction, and LSTM, GRU, and XGBoost were introduced as comparison models under the same information conditions. During inference, the model did not use observed future greenhouse air temperature or observed future exogenous variables. Instead, predicted temperatures were progressively fed back into the input window, and future exogenous variables were recursively generated by an exogenous-variable generator, thereby simulating an autonomous forecasting process closer to practical online deployment. Under unified data partitioning, input variables, historical window length, and evaluation metrics, LNN, LSTM, GRU, and XGBoost were evaluated in one-step prediction and in strict recursive closed-loop forecasting over 6 h, 24 h, and 48 h horizons. In addition, exogenous-variable generation errors and their correlations with greenhouse air temperature prediction errors were analysed, and protocol ablation experiments were conducted to examine how different future exogenous-variable acquisition methods affect multi-horizon forecasting performance. The aim of this study was therefore to provide a deployment-oriented recursive evaluation protocol for greenhouse air temperature forecasting and to reveal how errors from generated exogenous variables propagate into long-horizon temperature prediction when future sensor observations are unavailable.

2. Materials and Methods

2.1. Data Source

The experiment was conducted in a solar greenhouse used for tomato production from 1 January 2024 to 30 December 2024. The sensor sampling interval was 30 min, and 17,520 raw time-series records were obtained. Each record represented the sensor reading stored at the corresponding 30 min timestamp; wind speed and photosynthetically active radiation (PAR) were therefore used as instantaneous recorded values rather than 30 min averaged values. The greenhouse was 100 m long in the east–west direction, 12 m wide in the north–south direction, and 8 m high at the ridge. It was equipped with common production management facilities, including a roller-shutter system and water-fertilizer irrigation equipment.
To construct a multi-source environmental sensing dataset for greenhouse air temperature forecasting, environmental data acquisition nodes were installed inside the greenhouse at 20, 40, 60, and 80 m along the east–west direction. The sensors were mounted at a height of 1.5 m to continuously collect indoor air temperature, indoor relative humidity, and CO2 concentration. Soil moisture sensors were installed inside the greenhouse at a depth of 20 cm to characterize the root-zone water status. Outdoor environmental data were collected using a small weather station, including outdoor air temperature, outdoor relative humidity, photosynthetically active radiation (PAR), and wind speed. In this study, PAR was used to represent the solar-radiation variable in the forecasting model. All environmental sensors used in this study were manufactured by Shandong JianDa RenKe Measurement and Control Technology Co., Ltd. (Weifang, China). Together, the indoor and outdoor sensors constituted a multi-source greenhouse environmental monitoring system, providing historical state variables and exogenous driving variables for greenhouse air temperature forecasting. The main technical specifications of the sensors are listed in Table 1. The collected data were transmitted from the sensor nodes to an Internet of Things gateway, uploaded to a server via a 4G network, and stored in an environmental monitoring database. The sensor monitoring data were then processed through missing-value imputation, outlier screening, feature construction, and standardization before being used for one-step prediction, strict recursive closed-loop forecasting, and exogenous-error propagation analysis. The greenhouse environmental data acquisition process is shown in Figure 1.

2.2. Data Preprocessing

This study used time-series data continuously collected by multi-source greenhouse environmental sensors. Previous greenhouse microclimate forecasting studies have commonly incorporated indoor and outdoor environmental variables, such as air temperature, relative humidity, solar radiation, wind speed, CO2 concentration, and soil-related variables, as model inputs to characterize the coupled effects of internal environmental states and external meteorological forcing on greenhouse temperature and humidity dynamics [31,32]. In this study, the collected variables included indoor air temperature, indoor relative humidity, outdoor air temperature, outdoor relative humidity, PAR, wind speed, soil moisture, CO2 concentration, and vapor pressure deficit (VPD). PAR was used to represent the solar-radiation input variable, and VPD was calculated as a derived variable from air temperature and relative humidity. The greenhouse air temperature at the next sampling time was used as the prediction target. Historical indoor air temperature and its derived features, indoor relative humidity, outdoor meteorological variables, PAR, wind speed, soil moisture, CO2 concentration, and VPD were jointly used as model inputs to characterize the historical thermal state, external meteorological boundary conditions, internal hydrothermal conditions, and sensor observation conditions of the greenhouse.

2.2.1. Missing Value Processing

During long-term continuous data acquisition, a small number of missing values may occur because of sensor communication delays, network transmission failures, or short-term device downtime. The continuity of timestamps and the completeness of variables were first checked. Short missing segments were filled using linear interpolation. For a small number of missing points at the boundaries of the sequence, where direct interpolation was not possible, the nearest valid value was used for filling. Data segments with long continuous missing periods that could not be reliably reconstructed were not used to construct valid prediction samples. Linear interpolation was calculated as follows:
x t   =   x t 1 + t t 1 t 2 t 1 ( x t 2 x t 1 )
where x t denotes the interpolated value at the missing time t , and x t 1 and x t 2 denote the adjacent valid observations before and after the missing point, respectively.

2.2.2. Outlier Processing

Outliers were identified based on the physical range of each variable and the continuity between adjacent time points. Observations outside a reasonable physical range were marked as outliers. These outliers were first set as missing values and then corrected using the same interpolation or nearest-valid-value filling method as that used for missing values. This procedure can be expressed as follows:
x t   =   N a N ,   x t   <   x min   o r   x t   >   x max x t ,   x min     x t     x max
where x t is the original observation, x t is the screened value, and x m i n and x m a x are the lower and upper physical bounds of the corresponding variable, respectively.

2.2.3. Input Feature Construction

After data cleaning, model input features were constructed from raw environmental variables, time-periodic features, lagged features, and derived features. Raw environmental variables described the internal greenhouse state and external environmental forcing. Time-periodic features included sine and cosine encodings of hour of day and day of year, representing diurnal and annual periodicity. Lagged features were used to describe historical dependence and thermal inertia in the greenhouse thermal environment. Derived features included the indoor–outdoor temperature difference, PAR-related interaction terms, lagged PAR terms, lagged outdoor temperature terms, temperature slopes, and other variables. These features were designed to improve the representation of temperature trends and delayed thermal responses in the greenhouse.

2.2.4. Data Standardization

Because the variables differed substantially in units and numerical ranges, both the input variables and the prediction target were standardized. The dataset was divided into fixed training, validation, and test sets at a ratio of 70:15:15, and the same split was used for all models and repeated runs. The standardization parameters were calculated only from the training set and then applied to the validation and test sets to avoid data leakage. Standardization was performed as follows:
x std   =   x μ x σ x
where x is the original variable, x s t d is the standardized variable, and μ x and σ x are the mean and standard deviation of the corresponding variable calculated from the training set, respectively.

2.3. Greenhouse Air Temperature Forecasting Model

2.3.1. Liquid Neural Network

Within the proposed strict recursive closed-loop forecasting framework, a Liquid Neural Network (LNN) was constructed as a recurrent forecasting model based on continuous-time dynamics. It was used to examine whether continuous state updates and learnable time constants can support recursive greenhouse air temperature prediction under multi-source environmental forcing. Unlike conventional discrete-time recurrent neural networks, the LNN updates hidden states through learnable time constants and nonlinear state equations. This structure provides a theoretically relevant modelling strategy for greenhouse thermal processes affected by solar radiation, outdoor meteorological conditions, soil moisture, and facility thermal inertia, while its long-horizon recursive stability needs to be evaluated through the proposed closed-loop protocol.
As shown in Figure 2, the proposed LNN model consists of four components: an input feature layer, a mapping layer, a liquid dynamics layer, and an output prediction layer. The model takes a historical multivariate environmental sequence with a length of L = 36 as input. Because the sampling interval is Δts = 30 min, each input window covers the environmental state over the past 18 h. The prediction target is the greenhouse air temperature at the next sampling time.
(1)
Input feature layer
The input feature layer was used to construct the historical state sequence of the greenhouse environment. At the k-th sampling point, the model input feature vector uk included raw environmental variables such as outdoor temperature, outdoor relative humidity, solar radiation, wind speed, soil moisture, CO2 concentration, VPD, and indoor relative humidity. It also included derived features constructed from historical indoor and outdoor temperatures, including the temperature difference, solar-radiation interaction terms, lagged radiation terms, lagged outdoor temperature terms, temperature slopes, and time-periodic encodings. These features jointly represented the external meteorological forcing, internal hydrothermal state, historical lag effects, and diurnal periodicity affecting greenhouse air temperature.
(2)
Input mapping
The mapping layer was used to project the multivariate environmental input into the liquid recurrent dynamics layer. In this study, the input features were not transformed by an independent feed-forward hidden layer. Instead, they entered the liquid state equation directly through the input weight matrix Win, serving as external driving terms for hidden-state updates. The continuous-time hidden-state vector is defined in Equation (4), and the state evolution equation is given in Equation (5):
h ( t ) = [ h 1 ( t ) ,   h 2 ( t ) ,   ,   h N ( t ) ] t
d h ( t ) d t = h ( t ) + W in u ( t ) + W rec h ( t ) + b rec + α h ( t ) 2 β h ( t ) 3 max ( τ c ,   τ min )
(3)
Liquid recurrent layer
The liquid dynamics layer is the core of the LNN and consists of 64 liquid neurons, corresponding to the hidden-state dimension selected in this study. Each liquid neuron corresponds to one component of the hidden-state vector, and all neurons are connected through the recurrent weight matrix W rec . At the k-th time step, the liquid cell receives the current input feature vector u k and the hidden state h k , and then updates the next hidden state h k + 1 using the learnable time constant τ c , recurrent weight matrix W rec , state-update bias b rec , and nonlinear polynomial terms. The discretized update form of the continuous dynamics is shown in Equation (6). This structure enables the model to progressively accumulate dynamic information within the historical input window and compress the environmental changes over the past 18 h into the hidden-state representation at the end of the window.
(4)
Output connected layer
The output prediction layer maps the hidden state obtained at the end of the liquid dynamics layer to the predicted greenhouse air temperature at the next sampling time. The model first obtains the prediction output in the standardized space through a linear readout structure and constrains the output range using a clipping function, as shown in Equation (7). The standardized output is then linearly calibrated using the validation set and inverse-standardized to the original physical scale, yielding the final greenhouse air temperature prediction T ^ in , k + 1 . During strict recursive closed-loop forecasting, this predicted temperature is fed back into the simulated input sequence and combined with future exogenous variables recursively generated by the exogenous-variable generator to construct the next-step input, thereby forming a “prediction–feedback–prediction” recursive process.
During strict recursive closed-loop forecasting, after completing one-step prediction, the model feeds the predicted greenhouse air temperature T ^ in , k + 1 back into the simulated sequence. This predicted temperature is then combined with the future exogenous variables generated by the exogenous-variable generator to construct the next-step input. The closed-loop input reconstruction process is shown in Equation (8). Through this process, the model does not read observed future greenhouse air temperature or observed future exogenous variables during inference. Instead, it relies on its own predicted temperature and generated exogenous driving variables to perform continuous rolling forecasting.
The remaining equations of the LNN are as follows:
h k + 1   =   clip ( h k + δ h k   +   W in u k   +   W rec h k   +   b rec   +   α h k 2 β h k 3 max ( τ c ,   τ min ) , h max ,   h max )  
y ^ n k + 1   = clip ( W out h k + 1 + b out , y max ,   y max )
u k + 1 = F [ T ^ in ,   k + 1 ,   u k + 1 exo ,   ϕ k + 1 ]
where h ( t ) is the continuous-time hidden-state vector; h i ( t ) is the state of the i-th neuron; N is the hidden-state dimension; t is the continuous-time variable; u ( t ) , W i n , W rec , and b rec denote the input feature vector, input-state weight matrix, recurrent weight matrix, and state-update bias vector, respectively; α and β are polynomial nonlinear coefficients; τ c is the time-constant vector; τ min is the lower bound of the time constant, set to 0.1 in this study; max ( τ c ,   τ min ) denotes an element-wise lower-bound constraint; denotes element-wise multiplication; h2 and h3 denote element-wise powers; k is the discrete sampling index; δ is the internal state-update step size of the LNN; hk and uk are the hidden state and input feature at the k-th sampling point, respectively; clip ( · , h max , h max ) denotes an element-wise clipping function that constrains the hidden state within [ h max , h max ] , where h max is the clipping threshold; y ^ n k   +   1   is the model output in the standardized space; W out and b out are the output-layer weight and bias parameters; T ^ i n , k + 1 is the calibrated and inverse-standardized greenhouse air temperature prediction at the next sampling time; u k + 1 e x o is the future environmental driving vector generated by the exogenous-variable generator; ϕ k + 1 contains the time-periodic encodings and related derived features; and F denotes the input feature reconstruction function in closed-loop forecasting.
Through the above structure, the LNN progressively updates its hidden state within the historical window and outputs the greenhouse air temperature at the next sampling time from the hidden state at the end of the window. During strict recursive closed-loop rolling inference, the model does not read observed future greenhouse air temperature. Instead, it feeds its own prediction back into the input sequence, while future exogenous variables are provided by the exogenous-variable generator. Therefore, the model can perform not only single-step temperature prediction but also strict recursive closed-loop rolling forecasting, which is used to evaluate the multi-horizon recursive performance of greenhouse air temperature prediction under practical online deployment conditions.

2.3.2. Model and Training Parameter Settings

To evaluate the forecasting performance of the LNN, three comparison models were selected: LSTM, GRU, and XGBoost. LSTM states go through input, forget, and output gates, making it suitable for modelling long-term temporal dependence. GRU simplifies the recurrent structure using update and reset gates, allowing sequence dynamics to be modeled with fewer parameters. XGBoost was used as a non-sequential tree-based model to provide a strong nonlinear machine-learning baseline.
All models used the same data partitioning, input variables, historical window length, and evaluation metrics. The inputs of LNN, LSTM, and GRU were three-dimensional temporal tensors. For XGBoost, the multivariate sequence within each historical window was flattened in chronological order into a two-dimensional static feature vector. This setting ensured that all models were compared under the same information conditions and avoided evaluation bias caused by differences in input information.
The hidden-state dimension of the LNN was set to 64. This configuration was selected by considering the recursive forecasting performance, model complexity, training stability, and overfitting risk under different key hyperparameter settings based on a one-factor sensitivity analysis, as detailed in Table A1. The model was trained using the AdamW optimizer, and weight decay was introduced to reduce the risk of overfitting. The complete model architectures and training settings, including the optimizer, learning rate, batch size, number of epochs, loss function, regularization, learning-rate schedule, and model-selection criteria, are summarized in Table A2.
To ensure a consistent and fair comparison among the four forecasting models, model-specific one-factor-at-a-time hyperparameter sensitivity analyses were conducted using the validation set. Four representative hyperparameters were examined for each model, while the remaining settings were fixed at their reference values. Each candidate setting was evaluated using three fixed random seeds, and the MAE and RMSE at the 6 h, 24 h, and 48 h recursive forecasting horizons were considered jointly. When the overall recursive error of two candidate settings differed by less than 1%, they were regarded as practically comparable, and the configuration with lower run-to-run variability, lower model complexity, or stronger regularization was retained. The test set was not used during hyperparameter selection. The detailed sensitivity results are provided in Supplementary Table S4. All model development, training, and data analysis procedures were performed using MATLAB R2024a.

2.3.3. Model Evaluation

To verify the forecasting performance of the LNN under the strict recursive closed-loop setting, root mean square error (RMSE) and mean absolute error (MAE) were used as the main evaluation metrics. All metrics were calculated after calibration and inverse standardization in the original physical scale. RMSE and MAE were calculated as follows:
R M S E   = 1 N i = 1 N z ^ i n , i z i n , i 2
M A E = 1 N i = 1 N z ^ i n , i z i n , i
where N is the number of samples, and z ^ i n , i and z i n , i are the predicted and observed values of the i-th sample, respectively.
For one-step prediction, all next-step prediction samples in the test set were evaluated. For strict recursive closed-loop multi-horizon forecasting, MAE and RMSE were calculated over all rolling prediction steps within the 6 h, 24 h, and 48 h forecasting windows. These metrics were used to evaluate error accumulation and recursive stability under different forecasting horizons.
To account for training randomness, the complete training and evaluation procedure was repeated using 10 fixed random seeds (42, 123, 456, 789, 1024, 2024, 2025, 2026, 2048, and 3407), and model performance was reported as mean ± standard deviation. Overall differences among the models were evaluated using the Friedman test. When the overall test was significant, pairwise comparisons were conducted using two-sided Wilcoxon signed-rank tests with Holm correction, with statistical significance determined at p < 0.05. The complete run-level results and pairwise statistical comparisons are provided in Supplementary Materials.

2.4. Strict Recursive Closed-Loop Forecasting and Exogenous-Variable Generation

2.4.1. Strict Recursive Closed-Loop Forecasting Strategy

To evaluate the long-term recursive capability of the model under deployment-oriented information constraints, this study adopted a strict recursive closed-loop multi-horizon forecasting protocol. Unlike the idealized evaluation setting in which future driving variables are known, strict recursive closed-loop forecasting does not use observed future greenhouse air temperature or observed future exogenous variables during inference. The model can access only historical observations before the forecast origin. During rolling forecasting, the simulated input sequence evolves using the model’s own predictions and the exogenous-variable generator, thereby avoiding information leakage and ensuring causal and fair evaluation.
The closed-loop forecasting process is shown in Figure 3. Let the forecast origin be k0, the historical window length be L = 36, and the current rolling step be s. The end of the current simulated sequence is then k = k0 + s − 1. The model first uses the current historical input window Uk to predict the greenhouse air temperature at the next sampling time, denoted as f θ ( U k ) . Meanwhile, the exogenous-variable generator uses the currently visible and historical simulated sequence Sk to generate the future driving variables, denoted as G(Sk). The predicted temperature, generated exogenous variables, and time-periodic and derived features ϕ k + 1 are then jointly passed to the feature reconstruction function to obtain the next-step input vector:
u k + 1   =   F f θ ( U k ) , G ( S k ) , ϕ k + 1
where u k + 1 is the reconstructed input feature vector at the next sampling time; F is the closed-loop input feature reconstruction function; f θ is the trained temperature forecasting model; U k is the current historical input window; f θ ( U k ) represents the predicted greenhouse air temperature T ^ in ,   k + 1 ; G is the exogenous-variable generator; S k is the currently visible historical or simulated sequence information; G ( S k ) represents the generated future exogenous driving vector u k + 1 e x o ; and ϕ k + 1 represents the time-periodic encodings and related derived features at the next sampling time.
At the k-th prediction step, the historical input window U k is fed into the temperature forecasting model f θ to obtain the predicted greenhouse air temperature T ^ i n , k + 1 at the next sampling time. At the same time, the exogenous-variable generator G ( S k ) generates the next-step exogenous variables based on the visible historical or simulated sequence. The feature reconstruction module F then combines the predicted temperature, generated exogenous variables, and time features to construct the next-step input vector u k + 1 Subsequently, u k + 1 is fed back into the input window to form the updated window u k + 1 , which is used for the next prediction step. This process is recursively repeated over the 6 h, 24 h, and 48 h forecasting horizons without using observed future greenhouse air temperature or observed future exogenous variables.

2.4.2. Exogenous-Variable Generator

Strict recursive closed-loop rolling forecasting requires that future exogenous variables should not be directly provided by observed values in the test set. Therefore, an exogenous-variable generator was constructed to provide future driving variables for the temperature forecasting model. The generated variables included outdoor temperature, outdoor relative humidity, solar radiation, wind speed, soil moisture, CO2 concentration, and indoor relative humidity. VPD was treated as a derived variable determined jointly by temperature and humidity. It was recalculated during feature reconstruction using the predicted temperature and generated humidity, rather than being directly read as an independent future exogenous variable.
For any exogenous variable z, the generator adopted a one-step linear prediction form. Its input features included the current value zk, first-order difference Δ z k , diurnal lag term z k 48 , and sine and cosine encodings of hour of day and day of year. Because the data sampling interval was 30 min, 48 sampling steps corresponded to 24 h. Therefore, z k 48 was used to represent the diurnal periodicity of the exogenous variable. The input feature vector and one-step generation process were defined as follows:
q z , k = 1 , z k , Δ z k , z k 48 , sin 2 π h k 24 , cos 2 π h k 24 , sin 2 π d k 365 , cos 2 π d k 365 T
z ^ k + 1 = W z T q z , k
where q z , k is the generator input feature vector for exogenous variable z at the k-th sampling point; z k is the current value of the exogenous variable; Δ z k   =   z k   z k 1 is the first-order difference; z k 48 is the diurnal lag term; h k is the current hour; d k is the day of year; w z is the parameter vector of the linear generator for variable z; and z ^ k + 1 is the generated value of the exogenous variable at the next sampling time.
To assess the limitations of the linear generator, a nonlinear residual gradient-boosted regression-tree generator (Residual-GBRT) was constructed as a diagnostic control. It retained the linear prediction as the backbone and learned the remaining residual from multivariate current values, first-order differences, 24 h lags, and time-cycle encodings under the same data split and recursive forecasting protocol. Because the primary temperature models were developed under the recursive input distribution produced by the linear generator, Residual-GBRT was not substituted into the main forecasting protocol.

2.4.3. Evaluation of Exogenous-Variable Generation Error and Error Propagation

To analyse the sources of strict recursive closed-loop forecasting error, the generation errors of the exogenous-variable generator were evaluated, and the relationship between exogenous-variable generation errors and greenhouse air temperature prediction errors was further analysed. Exogenous-variable generation errors were evaluated using MAE, RMSE, Bias, and normalized RMSE (NRMSE). The calculations of MAE and RMSE were consistent with those used for temperature prediction errors. Bias represents the mean deviation between generated and observed values and was used to determine whether the generator tended to overestimate or underestimate a variable. NRMSE represents the ratio of RMSE to the observed range of the corresponding variable and was used to compare relative error levels across variables with different units. Bias and NRMSE were calculated as follows:
B i a s z   =   1 m i = 1 m z ^ i z i
N R M S E z = 1 m i = 1 m z ^ i z i 2 z max z min
where m is the number of exogenous-variable generation samples; z ^ i and z i are the generated and observed values of the i-th sample, respectively; and z m a x and z m i n are the maximum and minimum observed values of the corresponding exogenous variable.
To further determine whether exogenous-variable errors were associated with greenhouse air temperature prediction errors, the Spearman correlation coefficient between the absolute generation error of each exogenous variable and the absolute prediction error of greenhouse air temperature was calculated:
ρ z ,   H   =   ρ s z ^ H z H , T ^ in ,   H T in ,   H
where ρ z , H is the Spearman correlation coefficient between the generation error of exogenous variable z and the greenhouse air temperature prediction error under forecasting horizon H; ρ s denotes the Spearman rank correlation function; z ^ H z H is the absolute generation error of the exogenous variable; and T ^ i n , H T i n , H is the absolute prediction error of greenhouse air temperature. The statistical significance of each Spearman correlation coefficient was evaluated using a two-sided test. Because eight exogenous variables were examined under three forecasting horizons, the resulting 24 p-values were adjusted using the Benjamini–Hochberg false discovery rate procedure to control for multiple comparisons. An FDR-adjusted p-value below 0.05 was considered statistically significant. By comparing the correlation coefficients under 6 h, 24 h, and 48 h forecasting horizons, the potential effect of exogenous-variable generation errors on the accumulation of greenhouse air temperature prediction errors can be analysed.

2.5. Ablation Experiment on Recursive Forecasting Protocols

To verify the necessity of the strict recursive closed-loop forecasting protocol and to analyse the effect of future exogenous-variable acquisition methods on multi-horizon temperature forecasting, ablation experiments on closed-loop forecasting protocols were designed based on the trained LNN model. All three protocols did not use observed future greenhouse air temperature. They differed only in the way future exogenous variables were obtained.
Semi-closed-loop forecasting used predicted greenhouse air temperature as feedback to update the input window, while future exogenous variables were taken from observed values in the test set. This protocol represented an ideal exogenous-driving condition and was used to evaluate the recursive forecasting capability of the temperature model under accurate future exogenous inputs. Strict recursive closed-loop forecasting also used predicted greenhouse air temperature as feedback, but future exogenous variables were recursively produced by the exogenous-variable generator. This protocol did not use observed future greenhouse air temperature or observed future exogenous variables and served as the main evaluation protocol for multi-horizon forecasting in this study. The persistence baseline for exogenous variables also used predicted greenhouse air temperature as feedback, but future exogenous variables were kept equal to the most recent visible values at the forecast origin. This baseline was used to evaluate the error level under a simple exogenous-variable assumption. The three forecasting protocols are shown in Table 2.
The ablation experiments were conducted over 6 h, 24 h, and 48 h forecasting horizons. Because the data sampling interval was 30 min, the three horizons corresponded to 12, 48, and 96 rolling prediction steps, respectively. The three protocols used the same test origins and evaluation procedure, and MAE and RMSE were calculated over all rolling steps within each forecasting window. By comparing semi-closed-loop forecasting with strict recursive closed-loop forecasting, the effect of exogenous-variable generation errors on closed-loop forecasting performance was analysed. By comparing strict recursive closed-loop forecasting with the persistence baseline, whether the exogenous-variable generator could reduce long-horizon prediction errors compared with a simple persistence strategy was evaluated.
In real greenhouse deployment, future outdoor meteorological variables may be obtained from weather forecasts, while some greenhouse-specific variables may depend on control schedules or management-event records. In the present study, however, historical weather-forecast products synchronized with the sensor dataset were not archived during data collection. Therefore, a quantitative forecast-based exogenous protocol could not be implemented without introducing additional external data sources that were not part of the original experimental record. The present ablation experiment therefore focused on three information conditions: ideal observed exogenous inputs, generated exogenous inputs, and persistence exogenous inputs.

3. Results

This section presents the results of strict recursive closed-loop forecasting for greenhouse air temperature. First, under the same data partitioning, input variables, historical window length, and evaluation metrics, the performance of LNN, LSTM, GRU, and XGBoost was compared in one-step prediction and in strict recursive closed-loop rolling forecasting over 6 h, 24 h, and 48 h horizons. Then, the prediction trajectories and predicted–observed scatter distributions were analysed to evaluate the ability of the models to track the dynamic variation of greenhouse air temperature and to characterize long-horizon recursive error patterns. On this basis, the generation errors of the exogenous-variable generator were further evaluated under different forecasting horizons, and the relationships between exogenous-variable errors and greenhouse air temperature prediction errors were analysed. Finally, ablation experiments on closed-loop forecasting protocols were conducted to examine the effects of different future exogenous-variable acquisition methods on the multi-horizon forecasting performance of the LNN.

3.1. Prediction Model Performance Analysis

Under the same data partitioning, input variables, historical window length, and evaluation metrics, LNN, LSTM, GRU, and XGBoost were evaluated in one-step prediction and in strict recursive closed-loop forecasting over 6 h, 24 h, and 48 h horizons. The results are shown in Table 3. In one-step prediction, the models used observed historical sequences to predict greenhouse air temperature at the next sampling time. In strict recursive closed-loop rolling forecasting, observed future greenhouse air temperature and observed future exogenous variables were not used during inference. Instead, future inputs were recursively constructed through predicted-temperature feedback and the exogenous-variable generator.
The Friedman tests showed significant overall differences among the four models for both MAE and RMSE at all forecasting horizons (p < 0.001). The Holm-adjusted pairwise comparisons further showed that the LNN achieved significantly lower one-step prediction errors than the other models, whereas the LSTM achieved significantly lower errors than the other models under the 6 h, 24 h, and 48 h strict recursive closed-loop forecasting horizons (padj < 0.05).
Across the 10 repeated runs, the LNN achieved the lowest one-step prediction errors, with an MAE of 0.4771 ± 0.0009 °C and an RMSE of 0.5996 ± 0.0010 °C. Compared with LSTM, GRU, and XGBoost, the mean MAE of the LNN was reduced by 6.51%, 10.22%, and 7.50%, respectively, and the corresponding RMSE reductions were 6.25%, 9.45%, and 7.14%. However, the model ranking changed under strict recursive closed-loop forecasting. LSTM achieved the lowest mean MAE and RMSE at the 6 h, 24 h, and 48 h horizons. Compared with LNN, the MAE of LSTM was lower by 8.70%, 10.08%, and 15.82% at the three horizons, respectively, while its RMSE was lower by 9.34%, 10.36%, and 16.63%, respectively. Prediction errors generally increased with the forecasting horizon, reflecting the accumulation of predicted-temperature feedback errors and exogenous-variable generation errors during recursion. From the 6 h to the 48 h horizon, the MAE and RMSE of the LNN increased by 22.16% and 23.22%, respectively, whereas the corresponding increases for LSTM were 12.63% and 13.31%. Thus, LSTM exhibited a slower horizon-dependent increase in recursive prediction error under the same evaluation protocol. These results confirm that one-step prediction accuracy and long-horizon recursive stability should be evaluated separately. The corresponding changes in MAE and RMSE across the different forecasting horizons are shown in Figure 4.
To further analyse the strict recursive closed-loop forecasting performance of the LNN during continuous temperature variation, the rolling prediction trajectories over the 6 h, 24 h, and 48 h horizons were visualized, as shown in Figure 5. Overall, the LNN was able to follow the main variation trend of greenhouse air temperature under different forecasting horizons. Within the 6 h horizon, the predicted curve was generally consistent with the observed curve, and the errors were mainly reflected in local amplitude deviations. As the forecasting horizon was extended to 24 h and 48 h, the diurnal peaks and valleys became more pronounced, and the prediction error range increased accordingly. In particular, the predicted curve showed a smoothing tendency at temperature peaks, valleys, and rapid transition stages, indicating that the LNN could maintain the overall temperature trend but still had limitations in capturing local extrema and abrupt changes. This phenomenon may be related to the recursive use of predicted temperatures and generated exogenous variables in the strict recursive closed-loop process. Once the generation errors of key driving variables, such as outdoor temperature and solar radiation, enter the input window, they can affect subsequent temperature predictions and lead to accumulated trajectory deviations over longer horizons.
To evaluate the overall prediction consistency of the models across all test samples, full-sample predictions were further analysed for each model, as shown in Figure 6.
As shown in Figure 6, under the 6 h forecasting horizon, the scatter points of all four models were generally concentrated near the 1:1 reference line, indicating good agreement between predicted and observed values. When the forecasting horizon was extended to 24 h and 48 h, the scatter distributions became more dispersed, and deviations increased in both high- and low-temperature ranges. This pattern reflected the accumulation of closed-loop recursive errors at the full-sample scale. Overall, all four models showed increased scatter dispersion as the forecasting horizon extended. LSTM showed the most stable full-sample prediction consistency under the strict recursive closed-loop setting, whereas the LNN maintained better consistency than GRU and XGBoost at the 24 h and 48 h horizons but did not exceed LSTM.

3.2. Exogenous-Variable Generation Error and Propagation Analysis

During strict recursive closed-loop forecasting, future exogenous variables cannot be directly provided by observed values in the test set. Instead, they must be recursively produced by the exogenous-variable generator. Because different exogenous variables have different levels of association with greenhouse air temperature, their generation errors may have different effects on the final temperature prediction results. Therefore, this section first analyses the correlations between each exogenous variable and greenhouse air temperature to identify the key driving variables most closely related to temperature variation. The generation performance of the exogenous-variable generator is then evaluated under different forecasting horizons. Finally, the correlations between exogenous-variable generation errors and greenhouse air temperature prediction errors are analysed to characterize how exogenous errors propagate into temperature prediction errors.

3.2.1. Correlation Analysis Between Exogenous Variables and Greenhouse Air Temperature

In strict recursive closed-loop rolling forecasting, future exogenous variables are recursively generated and then used as inputs for subsequent temperature prediction. Therefore, the degree to which different exogenous variables are associated with greenhouse air temperature is an important prerequisite for judging whether their generation errors may affect temperature prediction. If an exogenous variable has only a weak relationship with greenhouse air temperature, even a large generation error may not substantially amplify the temperature prediction error. In contrast, if an exogenous variable is closely related to greenhouse air temperature, its generation error is more likely to shift the predicted temperature trajectory after entering the closed-loop input window. Based on this consideration, the Spearman correlation coefficients between greenhouse air temperature and outdoor temperature, outdoor relative humidity, solar radiation, wind speed, soil moisture, CO2 concentration, indoor relative humidity, and VPD were calculated to identify key exogenous variables associated with greenhouse air temperature variation. The results are shown in Figure 7.
As shown in Figure 7, the correlations between different exogenous variables and short-term variations in greenhouse air temperature differed substantially. Outdoor temperature showed the strongest correlation with greenhouse air temperature, with a Spearman coefficient of ρ   =   0.453   ( p   <   0.001 ) . Solar radiation, VPD, and indoor relative humidity showed weak but significant positive correlations with greenhouse air temperature, with correlation coefficients of 0.135, 0.125, and 0.109, respectively, all reaching the p < 0.001 significance level. CO2 concentration showed a weak negative correlation with greenhouse air temperature, with ρ = 0.061   ( p = 0.0011 ) . Wind speed, outdoor relative humidity, and soil moisture showed weak correlations that did not reach statistical significance.
These results show that exogenous variables differed in their relevance to greenhouse air temperature prediction. Outdoor temperature had the closest relationship with short-term greenhouse air temperature variation. Although the correlation of solar radiation was weaker, it remained statistically significant. Therefore, under strict recursive closed-loop long-horizon forecasting, the generation accuracy of outdoor temperature and solar radiation deserves particular attention.

3.2.2. Exogenous-Variable Generation Performance Analysis

In strict recursive closed-loop forecasting, the model cannot directly use observed future exogenous variables and must rely on the exogenous-variable generator to recursively produce future driving variables. Therefore, the quality of exogenous-variable generation directly affects the stability of multi-horizon temperature forecasting. To analyse changes in exogenous-driving errors under different forecasting horizons, MAE, RMSE, Bias, and NRMSE were calculated for outdoor temperature, outdoor relative humidity, solar radiation, wind speed, soil moisture, CO2 concentration, indoor relative humidity, and VPD under the 6 h, 24 h, and 48 h horizons. The results are shown in Table 4.
As shown in Table 4, generation errors differed markedly among exogenous variables, and the errors of most variables increased as the forecasting horizon was extended. Solar radiation had relatively high absolute errors, with an MAE of 108.09 μmol m−2 s−1 and an RMSE of 175.51 μmol m−2 s−1 at the 48 h horizon. This result shows that the linear exogenous-variable generator had limited ability to reconstruct radiation peaks and short-term fluctuations. The MAE of outdoor temperature increased from 1.38 °C at 6 h to 1.96 °C at 48 h, and the MAE of outdoor relative humidity increased from 3.38% RH to 4.65% RH. These results indicate continuous bias accumulation in meteorological boundary conditions during long-horizon recursion. The MAE of indoor relative humidity increased from 3.75% RH to 4.69% RH, showing that estimation errors in the internal hydrothermal state of the greenhouse also increased as the forecasting horizon became longer.
A typical 48 h forecasting process was further selected to compare the observed and generated values of the main exogenous variables, as shown in Figure 8. The exogenous-variable generator generally tracked the main trends of variables such as outdoor temperature and outdoor relative humidity. This indicates that the linear generator based on the current value, first-order difference, diurnal lag term, and time-periodic encodings captured part of the periodic variation in exogenous variables. However, for variables with stronger fluctuations or stronger effects of management events, such as solar radiation, wind speed, and soil moisture, deviations remained between generated and observed values. Solar radiation was strongly affected by diurnal cycles, weather fluctuations, and shading changes, and the generated curve did not fully capture peaks and rapid changes. Wind speed showed strong random disturbances, making it difficult for the generated values to follow short-term fluctuations. Soil moisture was jointly affected by irrigation, evaporation, and crop water uptake, and local abrupt changes and long-term trend shifts were difficult to reconstruct accurately using a simple linear generator. These results show that the exogenous-variable generator provided the future driving variables required for strict recursive closed-loop forecasting, but its tracking ability differed among variables.
The relative error changes in different variables are shown in Figure 9. According to the NRMSE results, soil moisture showed the most pronounced increase in relative error, rising from 0.084 at 6 h to 0.180 at 48 h. This result indicates that soil moisture was more prone to trend shifts during long-horizon recursion. The NRMSE values of wind speed were 0.168, 0.169, and 0.169 under the 6 h, 24 h, and 48 h horizons, respectively. Although wind speed remained at a relatively high error level, it changed little as the horizon increased. This indicates that wind speed had strong inherent random fluctuations and was difficult to generate even in the short term, but it did not show obvious horizon-dependent error accumulation. The errors of CO2 concentration and VPD also increased as the forecasting horizon was extended, but the increases were relatively limited.
Overall, the exogenous-variable generator captured the main variation trends of some exogenous variables and provided the future exogenous variables required for strict recursive closed-loop forecasting. However, the generation errors showed clear variable-dependent differences. Solar radiation, outdoor temperature, soil moisture, and indoor relative humidity were the variables with more prominent generation errors under long forecasting horizons.
The diagnostic comparison between the linear generator and Residual-GBRT is presented in Supplementary Figure S1 and Supplementary Table S3. Residual-GBRT reduced both MAE and RMSE in 15 of the 21 variable–horizon combinations. The largest improvement occurred for solar radiation at the 48 h horizon, where MAE and RMSE decreased by 22.54% and 16.95%, respectively. Wind-speed errors decreased modestly, while improvements were also observed for indoor and outdoor relative humidity and CO2 concentration. In contrast, outdoor-temperature and soil-moisture errors were not consistently reduced. These results confirm that the linear generator underrepresented some nonlinear variations, particularly solar-radiation dynamics, but also show that nonlinear residual correction did not provide a universal advantage across all exogenous variables.

3.2.3. Propagation Analysis of Exogenous-Variable Errors

A large exogenous-variable generation error does not necessarily mean that it will substantially affect the greenhouse air temperature prediction result. Some variables may have large generation errors, but if their direct driving effect on greenhouse air temperature is weak within the current forecasting horizon, they may not noticeably amplify the temperature prediction error. In contrast, thermal boundary and energy input variables, such as outdoor temperature and solar radiation, may have a more direct effect on temperature trajectory shifts even when their errors are not the largest among all variables. Therefore, after evaluating exogenous-variable generation performance, the Spearman correlation coefficients between the absolute generation error of each exogenous variable and the absolute prediction error of greenhouse air temperature were calculated. The results are shown in Figure 10.
As shown in Figure 10, outdoor-temperature generation error was significantly and positively correlated with greenhouse air temperature prediction error at the 6 h, 24 h, and 48 h horizons, with Spearman correlation coefficients of 0.3119, 0.3294, and 0.4674, respectively (FDR-adjusted p < 0.001). Solar-radiation generation error also showed significant positive correlations at the three forecasting horizons, with coefficients of 0.1928, 0.2070, and 0.2955, respectively (FDR-adjusted p < 0.001). The increasing correlation coefficients indicate that the generation errors of these two thermal-driving variables became more closely associated with greenhouse air temperature prediction deviations as the recursive forecasting horizon increased.
Several other variables also showed statistically significant correlations because of the large number of error observations; however, their correlation coefficients were generally small. For example, the absolute correlations for wind speed, soil moisture, CO2 concentration, indoor relative humidity, and VPD were mostly below 0.10. Therefore, statistical significance was interpreted together with correlation magnitude. Outdoor temperature showed the strongest and most consistent association with temperature prediction error, while solar radiation showed a weaker but stable positive association. These results indicate that outdoor temperature and solar radiation were the more practically relevant sources of propagated exogenous error under strict recursive closed-loop forecasting.

3.3. Ablation Experiment Results

To verify the necessity of the strict recursive closed-loop forecasting protocol and to analyse the effect of future exogenous-variable acquisition methods on the multi-horizon forecasting performance of the LNN, three closed-loop forecasting protocols were designed based on the trained LNN model. All three protocols did not use observed future greenhouse air temperature, and all used predicted-temperature feedback to update the input window. The only difference among them was the source of future exogenous variables. In semi-closed-loop forecasting, future exogenous variables were taken from observed values in the test set. In strict recursive closed-loop forecasting, future exogenous variables were recursively generated by the exogenous-variable generator. In the persistence baseline for exogenous variables, future exogenous variables were kept equal to the most recent visible values at the forecast origin. The prediction errors of the LNN under different protocols are shown in Table 5, and the corresponding error changes are shown in Figure 11.
As shown in Table 5, the source of future exogenous variables had a clear effect on the closed-loop forecasting performance of the LNN. Semi-closed-loop forecasting achieved the lowest errors at the 6 h, 24 h, and 48 h horizons, with MAE/RMSE values of 0.5094/0.6422 °C, 0.5104/0.6425 °C, and 0.5107/0.6421 °C, respectively. The errors changed only slightly as the forecasting horizon increased, indicating that the temperature feedback recursion of the LNN remained relatively stable under the ideal condition in which future exogenous variables were accurately available. In contrast, strict recursive closed-loop forecasting no longer used observed future exogenous variables and instead relied on the exogenous-variable generator to construct future inputs. Its MAE/RMSE values increased to 0.6607/0.8392 °C, 0.6925/0.8753 °C, and 0.8071/1.0341 °C at the 6 h, 24 h, and 48 h horizons, respectively. These errors increased with the forecasting horizon, showing that exogenous-variable generation errors further amplified long-horizon closed-loop prediction errors after entering the input window.
The persistence baseline for exogenous variables produced substantially higher errors than the other two protocols. Its MAE/RMSE values were 1.2172/1.5803 °C, 2.1037/2.6012 °C, and 2.0525/2.5313 °C at the 6 h, 24 h, and 48 h horizons, respectively. These results show that simply keeping future exogenous variables equal to the most recent observations at the forecast origin could not represent the diurnal cycles and short-term fluctuations of environmental driving variables such as solar radiation, outdoor temperature and humidity, and wind speed. Figure 11 shows the error differences among the three protocols. Semi-closed-loop forecasting had the lowest errors, strict recursive closed-loop forecasting had higher errors than semi-closed-loop forecasting but much lower errors than the persistence baseline, and the persistence baseline showed substantial error increases at the 24 h and 48 h horizons. These results indicate that although the exogenous-variable generator introduced generation errors, it still provided more effective future driving information than the simple persistence strategy.
Quantitatively, compared with semi-closed-loop forecasting, strict recursive closed-loop forecasting increased MAE and RMSE by 29.70% and 30.68% at 6 h, 35.68% and 36.23% at 24 h, and 58.04% and 61.05% at 48 h, respectively. This progressively widening difference indicates that the use of observed future exogenous variables increasingly underestimated deployment-oriented forecasting errors as the prediction horizon extended. Compared with the persistence baseline, strict recursive closed-loop forecasting reduced MAE and RMSE by 45.72% and 46.90% at 6 h, 67.08% and 66.35% at 24 h, and 60.68% and 59.15% at 48 h, respectively. From 6 h to 48 h, the MAE and RMSE under semi-closed-loop forecasting remained nearly unchanged, with changes of 0.26% and −0.02%, whereas they increased by 22.16% and 23.22% under strict recursive closed-loop forecasting and by 68.62% and 60.18% under the persistence baseline. These results quantitatively demonstrate both the underestimation caused by ideal future exogenous inputs and the benefit of generated exogenous variables relative to a simple persistence assumption.
Overall, using observed future exogenous variables clearly underestimated the prediction errors of the model under practical online deployment conditions, whereas strict recursive closed-loop forecasting more realistically reflected the recursive process jointly affected by predicted-temperature feedback and exogenous-variable generation errors. The ablation experiment demonstrated that multi-horizon greenhouse air temperature forecasting should not rely only on ideal exogenous-driving conditions or semi-closed-loop evaluation. Instead, long-term model stability should be tested under strict recursive closed-loop conditions. For the LNN, the results showed relatively stable closed-loop recursion when observed future exogenous variables were available, but its performance under strict recursive closed-loop conditions was still constrained by future exogenous-variable generation errors. Therefore, subsequent model optimization should focus on improving exogenous-variable generation accuracy and suppressing closed-loop error accumulation.

4. Discussion

4.1. Significance of Strict Recursive Closed-Loop Evaluation for Greenhouse Air Temperature Forecasting

Greenhouse air temperature forecasting models are ultimately intended to support online monitoring, low-temperature warning, ventilation regulation, auxiliary heating, and model predictive control. Their key requirement is not only to achieve low single-step errors on offline test sets, but also to generate reliable temperature trajectories over future control windows based on historical sensor observations. Previous studies have shown that model predictive control can coordinate greenhouse environmental targets and energy consumption, and data-driven forecasting models are becoming important components of greenhouse temperature control and energy-use assessment [3,4,33]. From the perspective of sensor-system applications, a deployed forecasting model can only access observations collected before the forecast origin, whereas future greenhouse air temperature and future exogenous sensor variables are unavailable. Software sensor and soft-measurement studies have also shown that computational models based on hardware sensing data are useful for estimating variables that are difficult to measure directly or obtain in real time [17,18]. Therefore, if observed future exogenous variables are used during evaluation, the resulting errors may represent an ideal information condition rather than realistic online deployment performance.
From a control perspective, these forecasting differences may directly affect the timing and intensity of greenhouse regulation actions. If a controller is designed using errors obtained under semi-closed-loop evaluation, its expected performance may be overly optimistic because future exogenous disturbances are assumed to be known. In practical model predictive control, underestimated forecasting uncertainty may lead to delayed heating or ventilation, insufficient shading before rapid daytime warming, or unnecessary energy consumption caused by overly aggressive corrective actions. Therefore, prediction models intended for greenhouse control should be evaluated under the same information constraints encountered during deployment, and the resulting forecast uncertainty should be incorporated into control constraints, safety margins, or robust decision rules rather than relying only on point predictions.
The ablation results in this study confirmed this effect. When observed future exogenous variables were used, the MAE of the LNN remained approximately 0.5094–0.5107 °C across the 6 h, 24 h, and 48 h horizons. Under strict recursive closed-loop conditions, future exogenous variables were recursively generated by the generator, and the MAE increased to 0.6607, 0.6925, and 0.8071 °C, respectively. This difference indicates that using observed future exogenous sensor variables can substantially underestimate long-horizon deployment errors and may lead to overestimation of subsequent control performance and energy-saving potential. This finding is consistent with multi-step time-series forecasting studies showing that recursive prediction is prone to error propagation [19], and with Scheduled Sampling research indicating that the mismatch between observed inputs during training and model-generated inputs during inference can induce error accumulation [20]. In greenhouse air temperature forecasting, this issue is further amplified because errors arise not only from predicted-temperature feedback, but also from uncertainty in future exogenous sensor variables. Therefore, strict recursive closed-loop evaluation is necessary for shifting greenhouse forecasting assessment from offline fitting accuracy toward online deployability.

4.2. Exogenous-Variable Generation Error as an Important Constraint on Long-Horizon Forecasting

Greenhouse air temperature is jointly affected by outdoor meteorological conditions, solar radiation, heat transfer through covering structures, ventilation heat exchange, heat storage and release by soil and structural components, and crop transpiration [1,2]. In short-horizon forecasting, the model can rely more heavily on recent historical temperature and environmental states for extrapolation. However, when the forecasting horizon is extended to 24 h or 48 h, the reliability of future driving variables becomes a key factor affecting the stability of predicted temperature trajectories. The results of this study showed that exogenous-variable generation errors generally increased with the extension of the forecasting horizon. Outdoor temperature, solar radiation, soil moisture, and greenhouse relative humidity showed relatively pronounced error accumulation over longer horizons. In particular, the MAE and RMSE of solar radiation reached 108.09 μmol m−2 s−1 and 175.51 μmol m−2 s−1 at the 48 h horizon, respectively, indicating that the simple linear exogenous-variable generator was still limited in reconstructing radiation peaks, weather fluctuations, and shading-related changes.
The influence of exogenous-variable errors on greenhouse air temperature prediction was variable-specific and was not determined solely by the magnitude of generation errors. Error propagation analysis showed that outdoor temperature and solar radiation errors had the most stable correlations with greenhouse air temperature prediction errors, and these correlations increased as the forecasting horizon extended. The Spearman correlation coefficient between outdoor-temperature error and temperature prediction error increased from 0.3119 at 6 h to 0.4674 at 48 h, while the corresponding coefficient for solar radiation increased from 0.1928 to 0.2955. Outdoor temperature determines the heat-exchange boundary between the greenhouse and the external environment, whereas solar radiation is the main energy input for daytime warming. Therefore, biases in these two variables are more likely to cause deviations in warming rate, peak temperature, and night-time cooling trends. Recent data-driven weather forecasting studies have also emphasized that uncertainty in future meteorological drivers affects multi-horizon forecasting and downstream decision-making [20,21]. From the perspective of greenhouse microclimate forecasting, this study further indicates that future exogenous variables should not be treated simply as known inputs; instead, they should be independently modelled and evaluated as key sources of uncertainty in strict recursive closed-loop long-horizon forecasting.

4.3. Model Applicability, Limitations, and Future Work

The LNN was introduced as a continuous-time candidate model because greenhouse air temperature exhibits continuous evolution, multi-time-scale variation, and thermal inertia. The repeated-run results showed that the LNN achieved significantly lower one-step prediction errors, whereas LSTM achieved significantly lower MAE and RMSE values under the 6 h, 24 h, and 48 h strict recursive closed-loop forecasting horizons. This differentiated performance may be related to the error-transmission characteristics of the two recurrent structures. The continuous state updates and learnable time constants of the LNN may support rapid responses to recent environmental changes and improve short-term fitting; however, small errors in recursively reconstructed inputs may also be progressively integrated into the liquid-state trajectory. By contrast, the LSTM cell-state pathway and its input, forget, and output gates explicitly regulate information retention and replacement, which may help preserve slower greenhouse thermal trends while attenuating short-term perturbations introduced by recursive feedback [24,25]. Because hidden-state sensitivity and state drift were not directly analysed, this explanation should be regarded as a mechanism-based interpretation rather than direct causal evidence. Therefore, the LNN should be considered a theoretically relevant continuous-time candidate with strong short-term fitting ability, rather than a model proven to be superior across all forecasting horizons.
This study has several limitations. First, the linear exogenous-variable generator had limited ability to represent abrupt solar-radiation changes, random wind-speed fluctuations, irrigation-induced soil-moisture variation, and other management disturbances. Second, the study was based on one tomato solar greenhouse in Alar over a single year. Therefore, the reported performance cannot establish direct transferability to different greenhouse structures, crops, climatic regions, management regimes, sensor layouts, or sampling intervals and should be interpreted as site-specific evidence for the proposed evaluation framework. Third, the strict recursive setting used generated exogenous variables rather than archived weather-forecast products.
Future work should compare linear, nonlinear, and probabilistic exogenous-variable generators and incorporate weather forecasts, facility-operation states, and management-event records. Multi-scenario validation should cover solar greenhouses, arched plastic greenhouses, and Venlo-type glass greenhouses across different crops, seasons, and climatic zones. Site-held-out or leave-one-greenhouse-out evaluation should be used to compare direct transfer and local recalibration under the same recursive forecasting protocol, while compatible public greenhouse microclimate datasets may provide additional external validation after variable and temporal harmonization. Real-greenhouse model predictive control experiments are also needed to determine how recursive forecasting errors affect actuator timing, temperature-constraint violations, environmental stability, and energy consumption. Future controllers should further compare deterministic MPC based on point forecasts with robust or uncertainty-aware MPC strategies that explicitly account for exogenous-variable generation errors [34,35].

5. Conclusions

This study designed a strict recursive closed-loop forecasting protocol and an exogenous-error propagation analysis framework for greenhouse air temperature prediction based on multi-source environmental sensing data. Within this framework, an LNN model was constructed as a continuous-time forecasting model to evaluate the feasibility of recursive closed-loop prediction, and its performance was compared with those of LSTM, GRU, and XGBoost under the same data partitioning, input variables, historical window length, and evaluation metrics. Across 10 repeated runs, the LNN achieved the lowest one-step prediction error, with an MAE of 0.4771 °C and an RMSE of 0.5996 °C, indicating good short-term fitting ability. However, under strict recursive closed-loop forecasting over the 6 h, 24 h, and 48 h horizons, LSTM achieved the lowest MAE and RMSE values, demonstrating stronger long-horizon recursive stability. The LNN remained more accurate than GRU and XGBoost at some long horizons, but it was not the best-performing model under the strict recursive setting. These results indicate that one-step prediction accuracy and long-horizon recursive stability should be evaluated separately in greenhouse air temperature forecasting.
At the same time, this study proposed an exogenous-variable generator to generate future exogenous inputs during strict recursive closed-loop forecasting. The results showed that the exogenous-variable generator could generally maintain the variation trends of the main environmental variables, but the generation difficulty differed among variables. The outdoor temperature generation error increased from an MAE of 1.38 °C at 6 h to 1.96 °C at 48 h. The MAE and RMSE of solar radiation reached 108.09 μmol m−2 s−1 and 175.51 μmol m−2 s−1, respectively, in 48 h forecasting. These results indicate that outdoor temperature and solar radiation are the main uncertainty sources in long-horizon forecasting. The ablation experiments further showed that the semi-closed-loop setting using observed future exogenous variables significantly underestimated model errors. In 48 h forecasting, the MAE and RMSE of strict recursive closed-loop forecasting increased by 58.04% and 61.05%, respectively, compared with semi-closed-loop forecasting, but decreased by 60.68% and 59.15%, respectively, compared with the persistence baseline. These results verified the necessity of strict recursive closed-loop evaluation and the practical forecasting value of the model.
In summary, the main contribution of this study is the establishment of a strict recursive closed-loop evaluation framework for greenhouse air temperature forecasting under conditions in which future sensor observations are unavailable. The results showed that the LNN improved one-step prediction accuracy, whereas LSTM provided stronger long-horizon recursive stability. Strict recursive closed-loop evaluation more realistically reflected error accumulation during long-horizon recursion when future sensor observations were unavailable. Exogenous-error propagation analysis further identified the main effects of key sensing variables, such as outdoor temperature and solar radiation, on temperature prediction errors. These results provide a basis for the selection, evaluation, and optimization of greenhouse air temperature forecasting models and offer a reference for greenhouse environmental online prediction and control decision-making based on sensor monitoring data. In practical greenhouse management, such multi-horizon temperature trajectories can provide early information for heating, ventilation, shading, irrigation scheduling, and energy-use optimization, especially when control decisions require sufficient lead time. However, before direct application to other greenhouses, the model should be recalibrated or revalidated using local sensor data, because its performance may be affected by greenhouse geometry, covering materials, ventilation mode, sensor placement, local climate, crop conditions, and sampling interval.

Supplementary Materials

The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/s26154717/s1, Figure S1: Diagnostic comparison of the linear and Residual-GBRT exogenous-variable generators; Table S1: Pairwise Wilcoxon signed-rank tests with Holm correction for repeated model performance; Table S2: Spearman correlations between absolute exogenous-variable generation errors and absolute greenhouse air temperature prediction errors under different forecasting horizons; Table S3: Comparison of linear and Residual-GBRT exogenous-variable generators under the 6 h, 24 h, and 48 h recursive forecasting horizons; Table S4: Validation-based one-factor-at-a-time hyperparameter sensitivity analysis for LNN, LSTM, GRU, and the tree-boosting baseline.

Author Contributions

A.Z.: Writing—original draft, Writing—review and editing, Methodology, Software, Validation, Data curation, Formal analysis, Visualization. S.Z.: Writing—review and editing, Validation, Data curation. J.B.: Conceptualization, Supervision, Project administration, Funding acquisition, Writing—review and editing. J.X.: Conceptualization, Methodology, Supervision, Project administration, Funding acquisition, Writing—review and editing. W.L.: Investigation, Data curation, Methodology, Writing—review and editing. H.G.: Methodology, Formal analysis, Writing—review and editing, Project administration. X.W.: Resources, Validation, Writing—review and editing, Project administration, Funding acquisition. All authors have read and agreed to the published version of the manuscript.

Funding

Bingtuan Innovative Team Project (2025DB014); Tianshan Talent Program (2024TSYCQNTJ005); Bingtuan Science and Technology Innovation Talent Project (2024DB031); the 14th Five-Year National Key R&D Program (2023YFD2000600); Bingtuan Key-Area Science and Technology Research Project (2023AB005-01); and the Division-City Science and Technology Research Plan Project (TDZKSS202440).

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The processed data, random-seed settings, complete repeated-run results, and statistical-analysis results used in this study are available from the corresponding authors upon reasonable request. The run-level performance results and complete Holm-adjusted pairwise comparisons are provided in the Supplementary Materials.

Conflicts of Interest

The authors declare no conflicts of interest. The funders had no role in the design of the study; in the collection, analyses, or interpretation of data; in the writing of the manuscript; or in the decision to publish the results.

Abbreviations

The following abbreviations are used in this manuscript:
ANNArtificial neural network
LCsLiquid cells
LNNLiquid Neural Network
GRUGated recurrent unit
XGBoostExtreme gradient boosting
LSTMLong short-term memory
IoTInternet of Things
RMSERoot mean square error
MAEMean absolute error
PARPhotosynthetically active radiation
RHRelative humidity
NRMSENormalized root mean square error
RNNRecurrent neural network
VPDVapor pressure deficit

Appendix A

Table A1. One-factor sensitivity analysis of key LNN hyperparameters under recursive forecasting horizons.
Table A1. One-factor sensitivity analysis of key LNN hyperparameters under recursive forecasting horizons.
Analysis ItemSettingMAE 6 hRMSE 6 hMAE 24 hRMSE 24 hMAE 48 hRMSE 48 h
Liquid neurons320.68990.87060.69580.87710.80411.0238
Liquid neurons640.68410.86320.69110.87090.79981.0193
Liquid neurons1280.68910.87070.69640.87860.80711.0294
Batch size160.68540.86570.69270.87380.80021.0187
Batch size320.68410.86320.69110.87090.79981.0193
Batch size640.68980.86980.69670.87710.80711.0254
Gradient clipping threshold0.50.67780.85490.68560.86390.79241.0101
Gradient clipping threshold1.00.68410.86320.69110.87090.79981.0193
Gradient clipping threshold2.00.68520.86440.69210.87210.80111.0206
Learning-rate scheduleWithout warmup0.67910.85640.68540.86360.79241.0096
Learning-rate scheduleWarmup + cosine annealing0.68410.86320.69110.87090.79981.0193
Note: MAE and RMSE are expressed in °C. The 6 h, 24 h, and 48 h horizons correspond to 12, 48, and 96 recursive prediction steps, respectively, because the sensor sampling interval was 30 min. In each one-factor sensitivity analysis, only the listed hyperparameter was changed, while the remaining settings were kept unchanged.
Table A2. Final model architectures and training settings used in this study.
Table A2. Final model architectures and training settings used in this study.
Setting ItemLNNLSTMGRUTree-Boosting Baseline
Input setting39 features; L = 3639 features; L = 3639 features; L = 3639 features; L = 36, flattened to 1404 predictors
Architecture64 liquid neurons; continuous recurrent liquid state2 LSTM layers; 64 hidden units; dropout = 0.32 GRU layers; 64 hidden units; dropout = 0.3Gradient-boosted regression trees implemented using XGBoost
Optimizer/learnerCustom AdamWAdamAdamXGBoost regressor
Learning rate1 × 10−3 max; 1 × 10−5 min8 × 10−41 × 10−30.05
Batch size323232
Epochs/rounds2008080120
Loss functionHuber loss (δ = 0.5)MSEMSESquared-error objective
Validation/model selectionLowest validation Huber loss; patience = 35Best validation-loss networkBest validation-loss networkBest learner count based on validation cumulative loss
Other settingsWeight decay = 1 × 10−4; gradient clipping = 1.0; 10-epoch warmup + cosine annealingPiecewise learning-rate schedule; drop factor = 0.5No learning-rate scheduleMaxNumSplits = 16; MinLeafSize = 5
Table A3. Friedman test results for repeated model performance over 10 random-seed runs.
Table A3. Friedman test results for repeated model performance over 10 random-seed runs.
Forecast HorizonMetricnFriedman χ2dfp-Value
One-stepMAE1030.0031.38 × 10−6
One-stepRMSE1030.0031.38 × 10−6
6 hMAE1028.0833.49 × 10−6
6 hRMSE1030.0031.38 × 10−6
24 hMAE1030.0031.38 × 10−6
24 hRMSE1028.0833.49 × 10−6
48 hMAE1030.0031.38 × 10−6
48 hRMSE1028.0833.49 × 10−6

References

  1. Shamshiri, R.R.; Jones, J.W.; Thorp, K.R.; Ahmad, D.; Che Man, H.; Taheri, S. Review of optimum temperature, humidity, and vapour pressure deficit for microclimate evaluation and control in greenhouse cultivation of tomato: A review. Int. Agrophys. 2018, 32, 287–302. [Google Scholar] [CrossRef]
  2. Vanthoor, B.H.E.; Stanghellini, C.; van Henten, E.J.; de Visser, P.H.B. A methodology for model-based greenhouse design: Part 1, a greenhouse climate model for a broad range of designs and climates. Biosyst. Eng. 2011, 110, 363–377. [Google Scholar] [CrossRef]
  3. Bersani, C.; Ouammi, A.; Sacile, R.; Zero, E. Model predictive control of smart greenhouses as the path towards near zero energy consumption. Energies 2020, 13, 3647. [Google Scholar] [CrossRef]
  4. Mahmood, F.; Govindan, R.; Bermak, A.; Yang, D.; Al-Ansari, T. Data-driven robust model predictive control for greenhouse temperature control and energy utilisation assessment. Appl. Energy 2023, 343, 121190. [Google Scholar] [CrossRef]
  5. Kocian, A.; Incrocci, L. Learning from data to optimize control in precision farming. Stats 2020, 3, 239–245. [Google Scholar] [CrossRef]
  6. Pal, G.; Roy, S.; Bag, J.K.; Pranav, P.K. A comprehensive review of machine learning and optimization techniques in agricultural system modelling: A cybernetics perspective. Comput. Electron. Agric. 2026, 241, 111188. [Google Scholar] [CrossRef]
  7. Seginer, I.; Boulard, T.; Bailey, B.J. Neural network models of the greenhouse climate. J. Agric. Eng. Res. 1994, 59, 203–216. [Google Scholar] [CrossRef]
  8. Ferreira, P.M.; Faria, E.A.; Ruano, A.E. Neural network models in greenhouse air temperature prediction. Neurocomputing 2002, 43, 51–75. [Google Scholar] [CrossRef]
  9. García-Vázquez, F.; Ponce-González, J.R.; Guerrero-Osuna, H.A.; Carrasco-Navarro, R.; Luque-Vega, L.F.; Mata-Romero, M.E.; Martínez-Blanco, M.R.; Castañeda-Miranda, C.L.; Díaz-Flórez, G. Prediction of internal temperature in greenhouses using supervised learning techniques: Linear and support vector regressions. Appl. Sci. 2023, 13, 8531. [Google Scholar] [CrossRef]
  10. Yuan, M.; Zhang, Z.; Li, G.; He, X.; Huang, Z.; Li, Z.; He, H. Multi-parameter prediction of solar greenhouse environment based on multi-source data fusion and deep learning. Agriculture 2024, 14, 1245. [Google Scholar] [CrossRef]
  11. Shi, D.; Yuan, P.; Liang, L.; Gao, L.; Li, M.; Diao, M. Integration of deep learning and sparrow search algorithms to optimize greenhouse microclimate prediction for seedling environment suitability. Agronomy 2024, 14, 254. [Google Scholar] [CrossRef]
  12. Francik, S.; Kurpaska, S. The use of artificial neural networks for forecasting of air temperature changes in a heated foil tunnel. Sensors 2020, 20, 652. [Google Scholar] [CrossRef] [PubMed]
  13. Codeluppi, G.; Davoli, L.; Ferrari, G. Forecasting air temperature on edge devices with embedded AI. Sensors 2021, 21, 3973. [Google Scholar] [CrossRef] [PubMed]
  14. Li, X.; Zhang, L.; Wang, X.; Liang, B. Forecasting greenhouse air and soil temperatures: A multi-step time series approach employing attention-based LSTM network. Comput. Electron. Agric. 2024, 218, 108602. [Google Scholar] [CrossRef]
  15. 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. [Google Scholar] [CrossRef]
  16. Oh, K.C.; Kim, J.G.; Cho, B.H.; Lee, S.Y. Greenhouse internal temperature prediction model. Agronomy 2024, 14, 2545. [Google Scholar] [CrossRef]
  17. Guesbaya, M.; García-Mañas, F.; Rodríguez, F.; Megherbi, H. A soft sensor to estimate the opening of greenhouse vents based on an LSTM-RNN neural network. Sensors 2023, 23, 1250. [Google Scholar] [CrossRef] [PubMed]
  18. Badreldin, N.; Cheng, X.; Youssef, A. An overview of software sensor applications in biosystem monitoring and control. Sensors 2024, 24, 6738. [Google Scholar] [CrossRef] [PubMed]
  19. Taieb, S.B.; Sorjamaa, A.; Bontempi, G. Multiple-output modelling for multi-step-ahead time series forecasting. Neurocomputing 2010, 73, 1950–1957. [Google Scholar] [CrossRef]
  20. Bengio, S.; Vinyals, O.; Jaitly, N.; Shazeer, N. Scheduled sampling for sequence prediction with recurrent neural networks. In Advances in Neural Information Processing Systems 28 (NIPS 2015); NeurIPS: San Diego, CA, USA, 2015. [Google Scholar]
  21. Lim, B.; Arik, S.Ö.; Loeff, N.; Pfister, T. Temporal fusion transformers for interpretable multi-horizon time series forecasting. Int. J. Forecast. 2021, 37, 1748–1764. [Google Scholar] [CrossRef]
  22. Rasp, S.; Dueben, P.D.; Scher, S.; Weyn, J.A.; Mouatadid, S.; Thuerey, N. WeatherBench: A benchmark dataset for data-driven weather forecasting. J. Adv. Model. Earth Syst. 2020, 12, e2020MS002203. [Google Scholar] [CrossRef]
  23. Lam, R.; Sanchez-Gonzalez, A.; Willson, M.; Wirnsberger, P.; Fortunato, M.; Alet, F.; Ravuri, S.; Ewalds, T.; Eaton-Rosen, Z.; Hu, W.; et al. Learning skillful medium-range global weather forecasting. Science 2023, 382, 1416–1421. [Google Scholar] [CrossRef] [PubMed]
  24. Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef] [PubMed]
  25. Chung, J.; Gulcehre, C.; Cho, K.; Bengio, Y. Empirical evaluation of gated recurrent neural networks on sequence modelling. arXiv 2014. [Google Scholar] [CrossRef]
  26. Chen, T.; Guestrin, C. XGBoost: A scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining, San Francisco, CA, USA, 13–17 August 2016; pp. 785–794. [Google Scholar] [CrossRef]
  27. Chen, R.T.Q.; Rubanova, Y.; Bettencourt, J.; Duvenaud, D. Neural ordinary differential equations. In Advances in Neural Information Processing Systems 31 (NeurIPS 2018); NeurIPS: San Diego, CA, USA, 2018. [Google Scholar]
  28. Rubanova, Y.; Chen, R.T.Q.; Duvenaud, D. Latent ordinary differential equations for irregularly-sampled time series. In Advances in Neural Information Processing Systems 32 (NeurIPS 2019); NeurIPS: San Diego, CA, USA, 2019. [Google Scholar]
  29. Hasani, R.; Lechner, M.; Amini, A.; Rus, D.; Grosu, R. Liquid time-constant networks. Proc. AAAI Conf. Artif. Intell. 2021, 35, 7657–7666. [Google Scholar] [CrossRef]
  30. Kidger, P.; Morrill, J.; Foster, J.; Lyons, T. Neural controlled differential equations for irregular time series. In Advances in Neural Information Processing Systems 33 (NeurIPS 2020); NeurIPS: San Diego, CA, USA, 2020. [Google Scholar]
  31. Gao, M.; Wu, Q.; Li, J.; Wang, B.; Zhou, Z.; Liu, C.; Wang, D. Temperature prediction of solar greenhouse based on NARX regression neural network. Sci. Rep. 2023, 13, 1563. [Google Scholar] [CrossRef] [PubMed]
  32. Yan, C.; Na, T.; Zhen, Q.; Sun, Y.; Liu, K. Prediction of air temperature and humidity in greenhouses via artificial neural network. PLoS ONE 2025, 20, e0325650. [Google Scholar] [CrossRef] [PubMed]
  33. Chen, S.; Liu, A.; Tang, F.; Hou, P.; Lu, Y.; Yuan, P. A review of environmental control strategies and models for modern agricultural greenhouses. Sensors 2025, 25, 1388. [Google Scholar] [CrossRef] [PubMed]
  34. Mallick, S.; Airaldi, F.; Dabiri, A.; Sun, C.; De Schutter, B. Reinforcement learning-based model predictive control for greenhouse climate control. Smart Agric. Technol. 2025, 10, 100751. [Google Scholar] [CrossRef]
  35. Choi, W.J.; Yang, M. Probabilistic deep learning framework for greenhouse microclimate prediction with time-varying uncertainty and covariance analysis. Agriculture 2025, 15, 2461. [Google Scholar] [CrossRef]
Figure 1. Greenhouse environmental monitoring and data acquisition system.
Figure 1. Greenhouse environmental monitoring and data acquisition system.
Sensors 26 04717 g001
Figure 2. Overall architecture of the proposed LNN for greenhouse air temperature forecasting: The model uses a historical multivariate environmental sequence with L = 36 and Δts = 30 min as input. The input sequence is mapped into the liquid dynamics layer through the input weight matrix Win. Liquid cells (LCs) update their hidden states using the current input, the previous hidden state, and learnable time constants. After the complete historical window is processed, the final hidden state is passed to the output prediction layer to predict greenhouse air temperature at the next sampling time.
Figure 2. Overall architecture of the proposed LNN for greenhouse air temperature forecasting: The model uses a historical multivariate environmental sequence with L = 36 and Δts = 30 min as input. The input sequence is mapped into the liquid dynamics layer through the input weight matrix Win. Liquid cells (LCs) update their hidden states using the current input, the previous hidden state, and learnable time constants. After the complete historical window is processed, the final hidden state is passed to the output prediction layer to predict greenhouse air temperature at the next sampling time.
Sensors 26 04717 g002
Figure 3. Schematic diagram of strict recursive closed-loop forecasting. Blue boxes and arrows represent the temperature prediction model and predicted-temperature feedback; green boxes and arrows represent the exogenous-variable generator and generated exogenous inputs; orange boxes and arrows represent time-periodic and derived features; and gray boxes represent feature reconstruction. Dashed arrows indicate the recursive transfer of the updated input window to the next forecasting step.
Figure 3. Schematic diagram of strict recursive closed-loop forecasting. Blue boxes and arrows represent the temperature prediction model and predicted-temperature feedback; green boxes and arrows represent the exogenous-variable generator and generated exogenous inputs; orange boxes and arrows represent time-periodic and derived features; and gray boxes represent feature reconstruction. Dashed arrows indicate the recursive transfer of the updated input window to the next forecasting step.
Sensors 26 04717 g003
Figure 4. Error comparison of different models under one-step prediction and strict recursive closed-loop forecasting: (a) MAE changes in LNN, LSTM, GRU, and XGBoost under one-step prediction and strict recursive closed-loop rolling forecasting over 6 h, 24 h, and 48 h horizons; (b) RMSE changes in the four models under the same forecasting settings. “One-step” denotes one-step prediction, whereas 6 h, 24 h, and 48 h denote strict recursive closed-loop rolling forecasting horizons.
Figure 4. Error comparison of different models under one-step prediction and strict recursive closed-loop forecasting: (a) MAE changes in LNN, LSTM, GRU, and XGBoost under one-step prediction and strict recursive closed-loop rolling forecasting over 6 h, 24 h, and 48 h horizons; (b) RMSE changes in the four models under the same forecasting settings. “One-step” denotes one-step prediction, whereas 6 h, 24 h, and 48 h denote strict recursive closed-loop rolling forecasting horizons.
Sensors 26 04717 g004
Figure 5. Strict recursive closed-loop forecasting trajectories and error changes in the LNN: (a) LNN forecasting trajectory and prediction error under the 6 h horizon; (b) LNN forecasting trajectory and prediction error under the 24 h horizon; (c) LNN forecasting trajectory and prediction error under the 48 h horizon.
Figure 5. Strict recursive closed-loop forecasting trajectories and error changes in the LNN: (a) LNN forecasting trajectory and prediction error under the 6 h horizon; (b) LNN forecasting trajectory and prediction error under the 24 h horizon; (c) LNN forecasting trajectory and prediction error under the 48 h horizon.
Sensors 26 04717 g005
Figure 6. Scatter distributions of predicted and observed values under different forecasting horizons: (ad) Prediction scatter plots of LNN, LSTM, GRU, and XGBoost under the 6 h horizon, respectively; (eh) prediction scatter plots of LNN, LSTM, GRU, and XGBoost under the 24 h horizon, respectively; (il) prediction scatter plots of LNN, LSTM, GRU, and XGBoost under the 48 h horizon, respectively. Each point represents one rolling prediction result under the corresponding forecasting horizon.
Figure 6. Scatter distributions of predicted and observed values under different forecasting horizons: (ad) Prediction scatter plots of LNN, LSTM, GRU, and XGBoost under the 6 h horizon, respectively; (eh) prediction scatter plots of LNN, LSTM, GRU, and XGBoost under the 24 h horizon, respectively; (il) prediction scatter plots of LNN, LSTM, GRU, and XGBoost under the 48 h horizon, respectively. Each point represents one rolling prediction result under the corresponding forecasting horizon.
Sensors 26 04717 g006
Figure 7. Correlation analysis between exogenous variables and greenhouse air temperature: The bar length represents the correlation strength. *** indicates p < 0.001, ** indicates p < 0.01, and variables without significance markers are not statistically significant.
Figure 7. Correlation analysis between exogenous variables and greenhouse air temperature: The bar length represents the correlation strength. *** indicates p < 0.001, ** indicates p < 0.01, and variables without significance markers are not statistically significant.
Sensors 26 04717 g007
Figure 8. Comparison between observed and generated values of major exogenous variables during a typical 48 h forecasting process: (a) Outdoor temperature. (b) Outdoor relative humidity. (c) Solar radiation. (d) Wind speed. (e) Soil moisture. (f) CO2 concentration. (g) Indoor relative humidity. (h) VPD.
Figure 8. Comparison between observed and generated values of major exogenous variables during a typical 48 h forecasting process: (a) Outdoor temperature. (b) Outdoor relative humidity. (c) Solar radiation. (d) Wind speed. (e) Soil moisture. (f) CO2 concentration. (g) Indoor relative humidity. (h) VPD.
Sensors 26 04717 g008
Figure 9. NRMSE of exogenous-variable generation errors and their relative increase from 6 h to 48 h: (a) NRMSE heatmap of exogenous-variable generation errors under 6 h, 24 h, and 48 h forecasting horizons; (b) relative increase in NRMSE from the 6 h to the 48 h forecasting horizon.
Figure 9. NRMSE of exogenous-variable generation errors and their relative increase from 6 h to 48 h: (a) NRMSE heatmap of exogenous-variable generation errors under 6 h, 24 h, and 48 h forecasting horizons; (b) relative increase in NRMSE from the 6 h to the 48 h forecasting horizon.
Sensors 26 04717 g009
Figure 10. Spearman correlation heatmap between absolute exogenous-variable generation errors and absolute greenhouse air temperature prediction errors: under the 6 h, 24 h, and 48 h forecasting horizons. Values in the circles represent Spearman correlation coefficients. *** indicate a Benjamini–Hochberg FDR-adjusted p < 0.001; correlations without significance markers are not statistically significant.
Figure 10. Spearman correlation heatmap between absolute exogenous-variable generation errors and absolute greenhouse air temperature prediction errors: under the 6 h, 24 h, and 48 h forecasting horizons. Values in the circles represent Spearman correlation coefficients. *** indicate a Benjamini–Hochberg FDR-adjusted p < 0.001; correlations without significance markers are not statistically significant.
Sensors 26 04717 g010
Figure 11. Distribution of absolute LNN prediction errors under different closed-loop forecasting protocols at the 6 h, 24 h, and 48 h forecasting horizons.
Figure 11. Distribution of absolute LNN prediction errors under different closed-loop forecasting protocols at the 6 h, 24 h, and 48 h forecasting horizons.
Sensors 26 04717 g011
Table 1. Main technical specifications of the environmental sensors.
Table 1. Main technical specifications of the environmental sensors.
PositionMonitoring VariableSensor/ModelMeasurement RangeAccuracy
Indoor, 1.5 m heightAir temperatureRS-WS-LORAH-2-2−40–120 °C±0.5 °C
Relative humidityRS-WS-LORAH-2-20–100% RH±2% RH
CO2 concentrationRS-CO2-LORAH-DC-20–5000 ppm±40 ppm
Soil, 20 cm depthSoil moistureRS-TR-LORAH-2-WS0–100%±2%
Outdoor weather stationAir temperatureRS-BYH-M−40–120 °C±0.5 °C
Relative humidityRS-BYH-M0–99% RH±3% RH
Photosynthetically active radiation (PAR)RS-GH-N01-AL0–2000 μmol m−2 s−1±5%
Wind speedRS-FSA-4G0–60 m s−1±0.2 m s−1
Table 2. Three closed-loop forecasting protocols.
Table 2. Three closed-loop forecasting protocols.
Prediction ProtocolFuture Greenhouse Air TemperatureFuture Exogenous Variables
Semi-closed-loop forecastingPredicted value feedbackObserved future exogenous variables
Strict recursive closed-loop forecastingPredicted value feedbackGenerated exogenous variables
Persistence exogenous-variable baselinePredicted value feedbackPersistence exogenous variables
Table 3. Repeated-run performance comparison of different models in one-step prediction and strict recursive closed-loop forecasting.
Table 3. Repeated-run performance comparison of different models in one-step prediction and strict recursive closed-loop forecasting.
Forecast HorizonMetricLNN (°C)LSTM (°C)GRU (°C)XGBoost (°C)
One-stepMAE0.4771 ± 0.00090.5103 ± 0.00120.5314 ± 0.00170.5158 ± 0.0021
One-stepRMSE0.5996 ± 0.00100.6396 ± 0.00140.6622 ± 0.00150.6457 ± 0.0018
6 hMAE0.6607 ± 0.00540.6032 ± 0.00410.6550 ± 0.00450.7080 ± 0.0006
6 hRMSE0.8392 ± 0.00710.7608 ± 0.00560.8170 ± 0.00610.9000 ± 0.0022
24 hMAE0.6925 ± 0.00790.6227 ± 0.00590.7271 ± 0.00920.7539 ± 0.0041
24 hRMSE0.8753 ± 0.00970.7846 ± 0.00790.9023 ± 0.01190.9522 ± 0.0096
48 hMAE0.8071 ± 0.01220.6794 ± 0.00970.8486 ± 0.01350.9051 ± 0.0025
48 hRMSE1.0341 ± 0.01470.8621 ± 0.01281.0560 ± 0.01771.1599 ± 0.0210
Note: Values are presented as mean ± standard deviation in °C over 10 repeated runs. Friedman test results are provided in Table A3, and complete Holm-adjusted pairwise comparisons are provided in Supplementary Table S1.
Table 4. Statistics of exogenous-variable generation errors under different forecasting horizons.
Table 4. Statistics of exogenous-variable generation errors under different forecasting horizons.
Forecasting HorizonExogenous VariableUnit for MAE/RMSE/BiasMAERMSEBiasNRMSE
6 hOutdoor temperature°C1.381.81−0.740.054
Outdoor relative humidity% RH3.384.37−1.430.069
Solar radiationμmol m−2 s−176.83128.10−25.170.109
Wind speedm s−10.851.030.010.168
Soil moisture%3.054.840.570.084
CO2 concentrationppm9.0211.570.140.111
Indoor relative humidity% RH3.755.01−1.150.101
VPDkPa0.110.140.010.092
24 hOutdoor temperature°C1.521.92−0.830.057
Outdoor relative humidity% RH3.734.69−1.550.074
Solar radiationμmol m−2 s−182.69134.60−28.150.115
Wind speedm s−10.851.030.010.169
Soil moisture%6.359.502.100.165
CO2 concentrationppm9.7212.300.240.118
Indoor relative humidity% RH4.175.50−1.660.111
VPDkPa0.120.150.020.098
48 hOutdoor temperature°C1.962.53−1.180.075
Outdoor relative humidity% RH4.655.90−2.180.093
Solar radiationμmol m−2 s−1108.09175.51−35.210.149
Wind speedm s−10.851.030.010.169
Soil moisture%7.0710.332.480.180
CO2 concentrationppm10.1912.860.430.124
Indoor relative humidity% RH4.696.24−2.280.125
VPDkPa0.130.170.030.108
Note: MAE, RMSE, and Bias are expressed in the unit listed for each exogenous variable and are rounded to two decimal places. NRMSE is dimensionless and is rounded to three decimal places. VPD is a derived variable reconstructed from temperature and humidity.
Table 5. Comparison of LNN prediction errors under different closed-loop forecasting protocols.
Table 5. Comparison of LNN prediction errors under different closed-loop forecasting protocols.
Forecasting ProtocolFuture Greenhouse Air TemperatureFuture Exogenous Variables6 h MAE/RMSE (°C)24 h MAE/RMSE (°C)48 h MAE/RMSE (°C)
Semi-closed-loop forecastingPredicted value feedbackObserved exogenous variables0.5094/0.64220.5104/0.64250.5107/0.6421
Strict recursive closed-loop forecastingPredicted value feedbackGenerated exogenous variables0.6607/0.83920.6925/0.87530.8071/1.0341
Persistence exogenous-variable baselinePredicted value feedbackPersistence exogenous variables1.2172/1.58032.1037/2.60122.0525/2.5313
Note: MAE and RMSE are expressed in °C.
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.

Share and Cite

MDPI and ACS Style

Zhang, A.; Zhang, S.; Bian, J.; Xing, J.; Li, W.; Gu, H.; Wang, X. Strict Recursive Closed-Loop Evaluation of Greenhouse Air Temperature Forecasting with Generated Exogenous Variables and Exogenous-Error Propagation Analysis. Sensors 2026, 26, 4717. https://doi.org/10.3390/s26154717

AMA Style

Zhang A, Zhang S, Bian J, Xing J, Li W, Gu H, Wang X. Strict Recursive Closed-Loop Evaluation of Greenhouse Air Temperature Forecasting with Generated Exogenous Variables and Exogenous-Error Propagation Analysis. Sensors. 2026; 26(15):4717. https://doi.org/10.3390/s26154717

Chicago/Turabian Style

Zhang, Aiguang, Shuo Zhang, Jingyu Bian, Jianfei Xing, Wentao Li, Hong Gu, and Xufeng Wang. 2026. "Strict Recursive Closed-Loop Evaluation of Greenhouse Air Temperature Forecasting with Generated Exogenous Variables and Exogenous-Error Propagation Analysis" Sensors 26, no. 15: 4717. https://doi.org/10.3390/s26154717

APA Style

Zhang, A., Zhang, S., Bian, J., Xing, J., Li, W., Gu, H., & Wang, X. (2026). Strict Recursive Closed-Loop Evaluation of Greenhouse Air Temperature Forecasting with Generated Exogenous Variables and Exogenous-Error Propagation Analysis. Sensors, 26(15), 4717. https://doi.org/10.3390/s26154717

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop