Multi-Step Forecasting of Grape Berry Temperature based on LSTM Model with Feed-Forward Attention
Authors: Srikanth Gorthi, L. G. Divyanth, Dattatray Bhalekar, Markus Keller, Lav Khot
Organizations: Center for Precision and Automated Agricultural Systems & Department of Biological Systems Engineering, Washington State University, Prosser, WA, USA · AgWeatherNet, Washington State University, Prosser, WA, USA · Department of Biological & Environmental Engineering, Cornell University, Ithaca, NY, USA · Department of Viticulture and Enology, Washington State University, Prosser, WA, USA
Accurate forecasting of grape berry temperature (Tb) is essential for enabling timely heat stress management in vineyards. In this study, a feed-forward attention mechanism integrated with a Long Short-Term Memory network (FAM-LSTM) was developed and evaluated for multi-step, high-resolution Tb prediction. Models were trained using environmental data from 2023 and 2024 at Prosser, WA, USA, and validated on 2025 summer data. FAM-LSTM was benchmarked against LSTM, GRU, RNN, and Random Forest (RF) across horizons ranging from 15 minutes to 72 hours (288 time steps). Two input scenarios were evaluated: nearest open-field weather station observations and in-vineyard microclimate measurements. FAM-LSTM consistently outperformed all benchmark models across all horizons and input scenarios. Incorporating in-vineyard microclimate data significantly improved forecasting accuracy at longer horizons. Using open-field data, FAM-LSTM achieved MAE and RMSE ranges of 0.58 to 1.70 deg C and 0.65 to 2.07 deg C, respectively. In-vineyard observations further improved performance, with MAE and RMSE in the ranges of 0.51 to 1.55 deg C and 0.71 to 1.87 deg C. Error analysis showed prediction uncertainty was highest during peak daytime periods (11:00 to 18:00) and increased progressively with forecast horizon. Overall, the FAM-LSTM framework offers robust Tb forecasting to support precision heat stress management in vineyards.
Figures & tables
Figure 1: The experimental setup to collect berry temperature (thermistor insertion, highlighted in red) and in-vineyard microclimate (air temperature and humidity and soil moisture probe) data using LoRaWAN sensing node.
Model
Metric
t+1
t+4
t+24
t+48
t+96
t+192
t+288
15 min
1 h
6 h
12 h
24 h
48 h
72 h
RF
MAE
1.05
1.59
1.76
1.86
2.36
2.43
2.45
RMSE
1.44
2.05
2.25
2.41
3.01
3.11
3.14
MAPE
5.35
7.78
8.43
9.21
11.99
12.04
12.12
RNN
MAE
0.94
1.07
1.58
1.71
1.75
1.86
1.95
RMSE
1.14
1.36
1.98
2.07
2.14
2.26
2.36
Table 1: Prediction performance of evaluated models using open-field weather inputs across multiple forecast time horizons.
Figure 3: Berry temperature ( Tb ) forecasts with feed-forward attention mechanism and long-short term memory (FAM-LSTM) using open-field weather station dataset for a) 12-h, b) 24-h, c) 48-h, and d) 72-h.
Model
Metric
t+1
t+4
t+24
t+48
t+96
t+192
t+288
15 min
1 h
6 h
12 h
24 h
48 h
72 h
RF
MAE
1.01
1.40
1.70
1.78
1.95
2.02
2.17
RMSE
1.39
1.81
2.08
2.15
2.40
2.34
2.84
MAPE
5.02
6.68
7.98
8.11
9.45
9.56
10.35
RNN
MAE
0.85
1.10
1.54
1.68
1.72
1.69
1.71
RMSE
1.09
1.37
1.85
2.01
2.10
2.15
2.15
Table 2: Prediction performance of evaluated models using in-vineyard weather inputs across multiple forecast horizons.
Figure 4: Berry temperature ( Tb ) forecasts with feed-forward attention mechanism and long-short term memory (FAM-LSTM) using in-vineyard dataset for a) 12-h, b) 24-h, c) 48-h, and d) 72-h.
Forecast period
Zone
MAE
RMSE
MAPE (%)
0–24 h
Peak Temp (max)
1.66
1.66
3.85
11:00–18:00
1.66
1.68
4.12
18:00–11:00 (next)
0.86
1.01
3.44
24–48 h
Peak Temp (max)
1.67
1.67
3.93
11:00–18:00
1.78
1.82
4.29
18:00–11:00 (next)
1.17
1.30
4.17
Table 3: Diurnal zone error analysis for the open-field FAM-LSTM model across 24-h forecast sub-periods. MAE and RMSE are expressed in ∘ C, and MAPE is expressed in %.
Forecast period
Zone
MAE
RMSE
MAPE (%)
0–24 h
Peak Temp (max)
1.17
1.17
2.71
11:00–18:00
1.04
1.07
2.69
18:00–11:00 (next)
0.55
0.64
2.66
24–48 h
Peak Temp (max)
1.35
1.35
3.16
11:00–18:00
1.30
1.32
3.32
18:00–11:00 (next)
0.79
0.86
3.54
Table 4: Diurnal zone error analysis for the in-vineyard FAM-LSTM model across 24-h forecast sub-periods. MAE and RMSE are expressed in ∘ C, and MAPE is expressed in %.
Forecast errors in high-resolution numerical weather prediction (NWP) systems are often linked to unresolved planetary boundary layer (PBL) processes, convection, terrain-induced circulations, and other vertically structured atmospheric phenomena. Previous work demonstrated that Long Short-Term Memory (LSTM) networks can successfully predict forecast errors in the High-Resolution Rapid Refresh (HRRR) model using mesonet observations, but we believe performance degradation is linked to periods of complex vertical atmospheric evolution. To address this limitation, we develop a hybrid LSTM-Vision Transformer (LSTM-ViT) framework that combines temporal sequence learning from surface observations with atmospheric profiles from the New York State Mesonet profiler network. The LSTM-ViT framework is trained to predict HRRR hourly precipitation, 10 m wind speed, and 2 m temperature forecast errors at individual mesonet stations. Across all three predictors, incorporation of profiler-derived atmospheric structure improves forecast error prediction skill relative to the baseline LSTM architecture, with the largest gains occurring at shorter forecast lead times and during periods of enhanced PBL activity. Improvements are particularly pronounced for precipitation forecast error, where the LSTM-ViT framework achieves approximately a twofold increase in predictive skill relative to the baseline LSTM while better capturing convectively driven error evolution and reducing degradation associated with PBL processes. These results demonstrate that combining temporal sequence learning with vertically informed attention mechanisms provides a physically meaningful pathway for improving forecast error prediction in operational NWP systems. Our research offers forecasters enhanced guidance regarding model bias and forecast confidence.
David Aaron Evans, Jay C. Rothenberger, Kara J. Sulia +2
Atmospheric Sciences Research Center, University at Albany, SUNY, Albany, NY, USA · University of Oklahoma, Norman, OK, USA · State Weather Risk Communication Center, University at Albany, SUNY, Albany, NY, USA
Accurate prediction of grape phenology is essential for timely vineyard management decisions, such as scheduling irrigation and fertilization, to maximize crop yield and quality. While traditional biophysical models calibrated on historical field data can be used for season-long predictions, they lack the precision required for fine-grained vineyard management. Deep learning methods are a compelling alternative but their performance is hindered by sparse phenology datasets, particularly at the cultivar level. We propose a hybrid modeling approach that combines multi-task learning with a recurrent neural network to parameterize a differentiable biophysical model. By using multi-task learning to predict the parameters of the biophysical model, our approach enables shared learning across cultivars while preserving biological structure, thereby improving the robustness and accuracy of predictions. Empirical evaluation using real-world and synthetic datasets demonstrates that our method significantly outperforms both conventional biophysical models and baseline deep learning approaches in predicting phenological stages, as well as other crop state variables such as cold-hardiness and wheat yield.
Fresh fruits and vegetables (FFVs) are highly perishable, and cold-chain breaks contribute significantly to global food waste. While Machine Learning (ML) can enable proactive intervention, cloud-based inference faces challenges such as latency and data loss. Fog computing addresses these issues but has been tested only in simulation for FFV cold-chain temperature prediction. To the best of the authors' knowledge, this paper presents its first real-world deployment. A fog-deployed LSTM-GRU model predicted cold-room temperature using LoRaWAN sensor data collected from a South African apple cold-storage facility with induced cold-chain breaks. Running entirely on a Raspberry Pi 4 with no cloud dependency, the system generated conditional SHAP explanations only when a break is predicted. The deployed system predicts cold-room temperature with an MAE of 0.2°C at roughly 0.2 kWh per day (≈0.7 Wh per prediction). Predictions were delivered in under one second (555 ms), dominated by network and messaging rather than computation, with conditional explanations adding modest cost. SHAP consumes 28% more CPU but is well within the hardware's capacity. The model attributes its predictions primarily to temperature, humidity, and their interaction. Critically, the deployment surfaced what simulation cannot: a sensor-triggered single point of failure, alongside genuine resilience, autonomous recovery from infrastructure faults and continued operation through internet loss. These are the first published deployment benchmarks for fog-based temperature prediction in FFV cold chains, establishing that explainable temperature forecasting is feasible on resource-constrained edge hardware. Future work includes asynchronous sensor fusion, commercial cold chain deployment, alternative model architectures, and causal analysis.
Jeremiah Taguta, Jean Frederic Isingizwe Nturambirwe, Clement Nthambazale Nyirenda
Department of Computer Science University of the Western Cape Cape Town, South Africa · eResearch Office University of the Western Cape Cape Town, South Africa