A Benchmark of Classical and Deep Learning Models for Agricultural Commodity Price Forecasting on A Novel Bangladeshi Market Price Dataset
Authors: Tashreef Muhammad, Tahsin Ahmed, Meherun Farzana, Md. Mahmudul Hasan, Abrar Eyasir, Md. Emon Khan, Mahafuzul Islam Shawon, Ferdous Mondol, Mahmudul Hasan, Muhammad Ibrahim
Organizations: Department of Computer Science and Engineering, Southeast University, Dhaka, Bangladesh · Department of Computer Science and Engineering, University of Dhaka, Bangladesh
Accurate short-term forecasting of agricultural commodity prices is critical for food security planning and smallholder income stabilisation in developing economies, yet machine-learning-ready datasets for this purpose remain scarce in South Asia. This paper makes two contributions. First, we introduce AgriPriceBD, a benchmark dataset of 1,779 daily retail mid-prices for five Bangladeshi commodities - garlic, chickpea, green chilli, cucumber, and sweet pumpkin - spanning July 2020 to June 2025, extracted from government reports via an LLM-assisted digitisation pipeline. Second, we evaluate seven forecasting approaches spanning classical models - naïve persistence, SARIMA, and Prophet - and deep learning architectures - BiLSTM, Transformer, Time2Vec-enhanced Transformer, and Informer - with Diebold-Mariano statistical significance tests. Commodity price forecastability is fundamentally heterogeneous: naïve persistence dominates on near-random-walk commodities. Time2Vec temporal encoding provides no statistically significant advantage over fixed sinusoidal encoding and causes catastrophic degradation on green chilli (+146.1% MAE, p<0.001). Prophet fails systematically, attributable to discrete step-function price dynamics incompatible with its smooth decomposition assumptions. Informer produces erratic predictions (variance up to 50x ground-truth), confirming sparse-attention Transformers require substantially larger training sets than small agricultural datasets provide. All code, models, and data are released publicly to support replication and future forecasting research on agricultural commodity markets in Bangladesh and similar developing economies.
Figures & tables
Study
Geo.
Commodity
DL
Learn. Temp.
Multi-commod.
BD Public Retail
Hassan et al. [ 4 ]
BD
Rice
–
–
–
–
Hasan et al. [ 5 ]
BD
Rice
✓
–
–
–
Imran et al. [ 6 ]
BD
Rice
✓
–
–
–
Islam et al. [ 26 ]
BD
Rice yield
✓
–
–
–
Bahar et al. [ 16 ]
MY
Palm oil
✓
–
–
–
Nensi et al. [ 17 ]
ID
Vegetables
✓
–
✓
–
Table 1: Gap analysis of related work. BD = Bangladesh; IN = India; MY = Malaysia; ID = Indonesia; TR = Turkey. ✓ = present; – = absent.
Figure 1: LLM-assisted dataset extraction pipeline. Daily government PDF market reports are parsed via the Gemini API using bilingual structured prompts (English and Bangla commodity name synonyms), validated against domain constraints, and aggregated into per-commodity CSV files. The forecast target is the retail mid-price: pt=(mint+maxt)/2 .
Figure 2: Cross-commodity Pearson correlation matrix of daily retail mid-prices (July 2020–June 2025). Garlic–chickpea show the strongest positive correlation ( r=0.61 ), reflecting shared import-parity pricing dynamics. Cucumber shows low correlation with green chilli ( r=0.09 ) and sweet pumpkin ( r=0.11 ), but a moderate correlation with chickpea ( r=0.44 ).
Commodity
ADF p
Min
Max
Mean
Std
Stationary?
R/S
Garlic
0.428
39.5
325.0
119.1
69.1
No
0.93
Chickpea
0.607
72.5
142.5
90.6
17.8
No
1.32
Green Chilli
0.003
0.0
260.0
87.3
56.2
Yes
0.74
Cucumber
<0.001
19.0
115.0
45.8
15.8
Yes
1.23
Sweet Pumpkin
0.008
11.5
52.5
25.3
7.3
Yes
0.70
Table 2: Dataset summary statistics (July 2020 – June 2025, prices in BDT/kg).
Figure 3: Architecture comparison. (a) Vanilla Transformer uses fixed sinusoidal positional encoding computed from sequence position. (b) T2V-Transformer replaces this with Time2Vec learnable temporal embeddings parameterised by global normalised time τ∈[0,1] . All other components are held constant across both variants, enabling a clean controlled ablation of the temporal encoding contribution.
Table 3: Hyperparameter settings for all models. DL models share the training protocol in the lower block. “Auto” = automatically selected by pmdarima’s Hyndman-Khandakar algorithm per commodity.
Commodity
Model
MAE
RMSE
MAPE (%)
Garlic
Naïve
4.66
8.04
3.95
SARIMA
15.28
24.51
9.73
Prophet
47.64
52.96
29.25
BiLSTM
5.34
7.01
4.65
Transformer
7.49
10.36
6.39
T2V-Transformer
18.85
22.71
16.63
Table 4: Forecasting performance: all models, all commodities, all metrics. Bold = best overall per metric per commodity; underline = best deep learning model. All MAE and RMSE values in BDT/kg; MAPE in percent.
Commodity
MAE
RMSE
MAPE (%)
PredVar (%)
Garlic
6.57
9.34
7.61
116.4
Chickpea
2.20
2.69
2.58
4987.4
Green Chilli
13.40
16.12
43.77
1108.2
Cucumber
9.67
13.48
32.73
40.9
Sweet Pumpkin
2.18
2.63
25.94
76.9
Table 5: Informer performance on all commodities. PredVar = prediction variance as a percentage of ground-truth variance. Values near 100% indicate well-calibrated variance; values ≫ 100% indicate erratic oscillating predictions; values ≪ 100% indicate under-dispersed predictions.
Commodity
Trans.
T2V
Δ MAE
Trans.
T2V
Δ RMSE
Trans.
T2V
MAE
MAE
RMSE
RMSE
MAPE
MAPE
Garlic
7.49
18.85
↑ 151.6%
10.36
22.71
↑ 119.2%
6.39%
16.63%
Chickpea
3.54
12.50
↑ 253.3%
3.98
12.96
↑ 225.9%
3.35%
11.81%
Green Chilli
7.38
18.16
↑ 146.1%
9.16
20.58
↑ 124.8%
17.09%
40.49%
Cucumber
9.44
10.91
↑ 15.5%
13.42
13.37
↓ 0.4%
15.40%
20.09%
Sweet Pumpkin
4.17
6.33
↑ 51.9%
4.94
7.31
↑ 48.0%
23.64%
39.09%
Table 6: Ablation study: Vanilla Transformer vs T2V-Transformer. All other architectural components are held constant.
Commodity
DM stat.
p -value
Direction
Sig.
Garlic
−16.378
<0.001
Trans. better
∗∗∗
Chickpea
−27.419
<0.001
Trans. better
∗∗∗
Green Chilli
−1.09×1010 †
<0.001
Trans. better
∗∗∗
Cucumber
+0.047
0.962
T2V marginal
n.s.
Sweet Pumpkin
−4.119
<0.001
Trans. better
∗∗∗
Table 7: Diebold-Mariano test (HLN corrected): T2V-Transformer vs Vanilla Transformer. 14-step-ahead, squared errors, HLN small-sample correction [ 30 ] . Positive DM stat indicates T2V-Transformer has lower loss (is more accurate). Significance: ∗∗∗p<0.01 , n.s. not significant.
Appendix figures & tables19 assets
Supplementary material from the paper’s appendix.
Appendix
Figure 4: Informer prediction on the garlic test set. Despite training convergence (early stopping at epoch 50), predictions follow an erratic oscillating pattern. Garlic shows relatively moderate prediction variance (PredVar 116%); other commodities show far worse inflation (chickpea: 4987%, green chilli: 1108%), indicating that ProbSparse attention cannot learn coherent structure from this training-set size.
Figure 5: STL decomposition – Garlic (BDT/kg). Non-stationary (ADF p=0.428 ). Trend follows a U-shape from 2020 to late 2024, reflecting a major import-supply disruption that drove retail prices sharply higher. Harvest-cycle periodicity is present (R/S ratio: 0.93), supporting exploitable periodic structure though training-scale constraints limit deep learning gains.
Figure 6: STL decomposition – Chickpea (BDT/kg). Non-stationary (ADF p=0.607 ). Smooth, monotonically accelerating upward trend from ≈ 73 BDT to ≈ 133 BDT. Seasonal amplitude is small relative to trend; residual spike in early 2024 corresponds to the portal-outage anomaly documented in Section 3.1 . Naïve persistence dominates; R/S ratio of 1.32 reflects relatively high residual noise.
Figure 7: STL decomposition – Green Chilli (BDT/kg). Stationary (ADF p=0.003 ). Residual amplitudes substantially exceed the trend component, reflecting exogenous shock dominance. Despite an R/S ratio of 0.74 suggesting detectable seasonality, naïve persistence dominates because price dynamics are threshold-driven (border closures, monsoon disruptions) rather than cycle-driven—a limitation of R/S as a forecastability proxy.
Figure 8: STL decomposition – Cucumber (BDT/kg). Stationary (ADF p<0.001 ). U-shaped trend ( ≈ 35–65 BDT). Seasonal oscillations are present but a moderate residual-to-trend ratio (R/S: 1.23) preserves a marginal advantage for SARIMA’s differencing-based approach over deep learning models.
Figure 9: STL decomposition – Sweet Pumpkin (BDT/kg). Stationary (ADF p=0.008 ). Bell-shaped trend peaking 2023–24. Seasonal oscillations reflect post-monsoon harvest cycles (R/S ratio: 0.70). Despite this periodic structure, DM testing confirms no statistically significant T2V advantage at this training scale.
Figure 10: Test-period forecasts – Garlic (May–June 2025). Ground truth (solid black) declines sharply in June 2025. Naïve and BiLSTM track most closely; SARIMA and Transformer diverge upward. T2V-Transformer (MAE 18.85) substantially underperforms the Vanilla Transformer (MAE 7.49) on this commodity. Prophet (not shown at this scale) predicts far below the actual retail price range.
Figure 11: Test-period forecasts – Chickpea (May–June 2025). Ground truth is near-flat ( ≈ 88–92 BDT/kg). Naïve persistence matches exactly by construction. Prophet diverges to ≈ 130 BDT, confirming inability to handle step-function dynamics. All other models cluster near naïve with small errors.
Figure 12: Test-period forecasts – Green Chilli (May–June 2025). Ground truth fluctuates between ≈ 28–90 BDT/kg in sharp discrete steps; all models fail to track these transitions. T2V-Transformer deviates most severely (MAE 18.16), consistent with overfitting to noise via spurious learnable frequencies.
Figure 13: Test-period forecasts – Cucumber (May–June 2025). SARIMA (MAE 8.97) is the best model overall by MAE; Transformer (MAE 9.44) is the best deep learning model by MAE. T2V-Transformer achieves a marginally better deep learning RMSE (13.37) vs Vanilla Transformer (13.42), a difference not statistically significant ( p=0.962 ). Prophet predicts below actual prices, consistent with its smooth-trend assumption failing.
Figure 14: Test-period forecasts – Sweet Pumpkin (May–June 2025). BiLSTM (MAE 2.66) is the best deep learning model; Vanilla Transformer (MAE 4.17) is second. Prophet substantially over-predicts actual retail prices, giving MAPE of 74.56%.
Figure 15: Training curves – Garlic. All three deep learning models converge cleanly with train and validation loss tracking closely, indicating good generalisation. T2V-Transformer reaches best validation loss in ≈ 25 epochs under early stopping.
Figure 16: Training curves – Chickpea. T2V-Transformer shows a persistent train-val gap: train loss approaches zero while validation loss plateaus, consistent with learnable temporal parameters overfitting the near-random-walk training series.
Figure 17: Training curves – Green Chilli (dropout =0.3 ). Despite increased regularisation, persistent train-val gap across all models reflects irreducible noise rather than modelling deficiency. Dropout increase prevents further divergence but cannot recover signal absent from the training data.
Figure 18: Training curves – Cucumber. Clean convergence across all models; T2V-Transformer validation loss tracks training loss closely, supporting the RMSE improvement observed on this commodity.
Figure 19: Training curves – Sweet Pumpkin (dropout =0.3 ). Under default dropout (0.1), all deep learning models showed validation loss divergence from early epochs. Increasing dropout to 0.3 substantially stabilised training; the Vanilla Transformer achieves the best deep learning performance on this commodity (MAE 4.17 BDT/kg).
Figure 20: Ablation study – MAE comparison across BiLSTM, Vanilla Transformer, and T2V-Transformer for all five commodities. T2V-Transformer degrades on all five commodities by MAE. Garlic ( +151.6% ) and chickpea ( +253.3% ) show the most extreme degradation alongside green chilli ( +146.1% , p<0.001 ).
Figure 21: Ablation study – RMSE comparison across BiLSTM, Vanilla Transformer, and T2V-Transformer for all five commodities. The sole RMSE improvement is a modest gain on cucumber ( ↓ 0.4%), which is not statistically significant ( p=0.962 , DM test, Table 7 ).
Figure 22: Ablation study – MAPE comparison across BiLSTM, Vanilla Transformer, and T2V-Transformer for all five commodities. Four of five commodities show statistically significant Transformer superiority ( p<0.001 ), confirming that learnable temporal encoding provides no benefit at this training scale.
Time series forecasting predicts future values from ordered observations using statistical, neural, and probabilistic models to support decisions under uncertainty.
Stricto Sensu Department, SENAI CIMATEC University, Salvador, Bahia, Brazil · Global Centre for Clean Air Research · Institute for Sustainability, University of Surrey, Guildford, GU2 7XH, United Kingdom +1