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 CO
2 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, CO
2 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.
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, CO
2 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
. 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. CO
2 concentration showed a weak negative correlation with greenhouse air temperature, with
. 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, CO
2 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 CO
2 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 CO
2 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.
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.