A Deep Learning-Based Prediction and Forecasting of Tomato Prices for the Cape Town Fresh Produce Market: A Model Comparative Analysis
Abstract
:1. Introduction
1.1. Research Rationale
1.2. Related Work
1.3. Research Contributions
- We investigated the effectiveness of two different econometric models (ARIMA and SARIMA), two traditional ML-based approaches (SVR and XGB), and a deep learning-based LSTM network method for accurate and optimized tomato price prediction and forecasting.
- We provided a comprehensive overview of existing related work and highlighted the efficacy of LSTM as a reliable deep learning method for time series analysis of fresh agricultural produce.
- We discussed different time series price forecasting methodologies and briefly highlighted their merits and applicability.
1.4. Paper Organization
2. Materials and Methods
2.1. Data Source
2.2. Data Description and Preparation
- Training dataset: January 2008–December 2018.
- Test dataset: January 2019–December 2021.
2.3. Model Development
2.3.1. Econometric Forecasting Approaches
The ARIMA Model
The SARIMA Model
2.3.2. Traditional ML Approaches
The SVR Model
The EXtreme Gradient Boost (XGB) Model
2.3.3. Deep Learning-Based LSTM Model
2.4. Model Evaluation
3. Results and Discussion
3.1. Data Description
3.2. Data Preprocessing
3.2.1. Non-Stationarity Test
3.2.2. Autocorrelation Function (ACF) and Partial Autocorrelation Function (PACF) Analysis
3.2.3. Nonlinearity Test
3.3. Results
3.3.1. ARIMA Model Result
3.3.2. SARIMA Model Result
3.3.3. SVR Model Result
3.3.4. XGB Model Result
3.3.5. LSTM Model Result
3.4. Discussion
4. Conclusions
Author Contributions
Funding
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Sun, F.; Meng, X.; Zhang, Y.; Wang, Y.; Jiang, H.; Liu, P. Agricultural product price forecasting methods: A review. Agriculture 2023, 13, 1671. [Google Scholar] [CrossRef]
- Wihartiko, F.D.; Nurdiati, S.; Buono, A.; Santosa, E. Agricultural price prediction models: A systematic literature review. In Proceedings of the International Conference on Industrial Engineering and Operations Management, Singapore, 7–11 March 2021; IEOM Society International: Southfield, MI, USA, 2021; pp. 2927–2934. [Google Scholar] [CrossRef]
- Zhang, Q.; Yang, W.; Zhao, A.; Wang, X.; Wang, Z.; Zhang, L. Short-term forecasting of vegetable prices based on LSTM model—Evidence from Beijing’s vegetable data. PLoS ONE 2024, 19, e0304881. [Google Scholar] [CrossRef] [PubMed]
- Santoso, I.; Purnomo, M.; Sulianto, A.A.; Choirun, A. Machine learning application for sustainable agri-food supply chain performance: A review. In Proceedings of the IOP Conference Series: Earth and Environmental Science, Banda Aceh, Indonesia, 21 September 2021; IOP Publishing Ltd.: Bristol, UK, 2021. [Google Scholar] [CrossRef]
- Zhao, C.; Wang, X.; Zhao, A.; Cui, Y.; Wang, T.; Liu, J.; Hou, Y.; Wang, M.; Chen, L.; Li, H.; et al. A vegetable-price forecasting method based on mixture of experts. Agriculture 2025, 15, 162. [Google Scholar] [CrossRef]
- Opara, I.K.; Fawole, O.A.; Opara, U.L. Postharvest losses of pomegranate fruit at the packhouse and implications for sustainability indicators. Sustainability 2021, 9, 5187. [Google Scholar] [CrossRef]
- Opara, I.K.; Fawole, O.A.; Kelly, C.; Opara, U.L. Quantification of on-farm pomegranate fruit postharvest losses and waste, and implications on sustainability indicators: South African case study. Sustainability 2021, 13, 5168. [Google Scholar] [CrossRef]
- Beckert, J. Where Do Prices Come from? Sociological Approaches to Price Formation; Max Planck Institute for the Study of Societies: Cologne, Germany, 2011; Available online: https://hdl.handle.net/10419/45619 (accessed on 14 February 2025).
- Yin, H.; Jin, D.; Gu, Y.H.; Park, C.J.; Han, S.K.; Yoo, S.J. STL-ATTLSTM: Vegetable price forecasting using stl and attention mechanism-based LSTM. Agriculture 2020, 10, 612. [Google Scholar] [CrossRef]
- Baiyegunhi, L.; Sharaunga, S.; Dlangisa, S.; Ndaba, N. Tomato market integration: A case study of the Durban and Johannesburg fresh produce markets in South Africa. J. Agribus. Rural Dev. 2018, 49, 239–249. [Google Scholar] [CrossRef]
- Directorate: Statistics and Economic Analysis. Abstract of Agricultural Statistics. Department of Agriculture, Land Reform & Rural Development, 2024. Pretoria, Republic of South Africa. Available online: https://www.dalrrd.gov.za/images/Branches/Economica%20Development%20Trade%20and%20Marketing/Statistc%20and%20%20Economic%20Analysis/statistical-information/abstract-2024.pdf (accessed on 14 February 2025).
- Department of Agriculture, Land Reform and Rural Development, Resource Centre. 2025. Available online: https://old.dalrrd.gov.za/Resource-Centre?folderId=377&view=gridview&pageSize=2147483647 (accessed on 14 February 2025).
- National Agricultural Marketing Council (NAMC). The-SA-Tomato-Value-Chain-Desktop-Study-2023-24. 2024. Available online: https://www.namc.co.za/wp-content/uploads/2024/03/The-SA-Tomato-Value-Chain-Desktop-Study-2023-24.pdf (accessed on 14 February 2025).
- Cherono, K. Development and Optimization of an Integrated Postharvest Management System for Storage and Handling of Fresh Market Tomatoes in South African Supply Chains. Ph.D. Thesis, University of KwaZulu-Natal, Pietermaritzburg, South Africa, 2016. [Google Scholar]
- Korsten, L. Postharvest Losses of Fresh Produce. The African Academy of Sciences, 2024. University of Pretoria. Available online: https://stopmedwaste.net/wp-content/uploads/2024/01/Postharvest-losses-of-Fresh-produce.pdf (accessed on 14 February 2025).
- Choong, K.Y.; Raof, R.A.A.; Sudin, S.; Ong, R.J. Time series analysis for vegetable price forecasting in e-commerce platform: A review. J. Phys. Conf. Ser. 2021, 1878, 012071. [Google Scholar] [CrossRef]
- Mienye, I.D.; Swart, T.G. A Comprehensive Review of deep learning: Architectures, recent advances, and applications. Information 2024, 15, 755. [Google Scholar] [CrossRef]
- Jin, B.; Xu, X. Predicting wholesale edible oil prices through Gaussian process regressions tuned with Bayesian optimization and cross-validation. Asian J. Econ. Bank. 2025, 9, 64–82. [Google Scholar] [CrossRef]
- Lim, B.; Zohren, S. Time-series forecasting with deep learning: A survey. Philos. Trans. R. Soc. A 2021, 379, 20200209. [Google Scholar] [CrossRef] [PubMed]
- Yuan, C.Z.; Ling, S.K. Long short-term memory model based agriculture commodity price prediction application. In Proceedings of the 2020 2nd International Conference on Information Technology and Computer Communications, Kuala Lumpur, Malaysia, 12–14 August 2020; pp. 43–49. [Google Scholar] [CrossRef]
- Murugesan, R.; Mishra, E.; Krishnan, A.H. Deep Learning Based Models: Basic LSTM, Bi LSTM, Stacked LSTM, CNN LSTM and Conv LSTM to forecast agricultural commodities prices. Res. Sq. 2021, 1, 1–32. [Google Scholar] [CrossRef]
- Avinash, G.; Ramasubramanian, V.; Paul, R.K.; Ray, M.; Dahiya, S.; Iquebal, M.A.; Godara, S.; Manjunatha, B. Price forecasting of top (tomato, onion and potato) commodities using Hidden Markov-based Deep learning approach. Stat. Appl. 2024, 22, 63–90. Available online: http://www.ssca.org.in/journal (accessed on 14 February 2025).
- Nassar, L.; Okwuchi, I.E.; Saad, M.; Karray, F.; Ponnambalam, K. Deep learning based approach for fresh produce market price prediction. In Proceedings of the International Joint Conference on Neural Networks (IJCNN), Glasgow, UK, 19–24 July 2020. [Google Scholar]
- Okwuchi, I.E. Machine Learning Based Models for Fresh Produce Yield and Price Forecasting for Strawberry Fruit. Master’s Thesis, University of Waterloo, Waterloo, ON, Canada, 2020. Available online: http://hdl.handle.net/10012/15976 (accessed on 14 February 2025).
- Kumari, P.; Goswami, V.; Harshith, N.; Pundir, R.S. Recurrent neural network architecture for forecasting banana prices in Gujarat, India. PLoS ONE 2023, 18, e0275702. [Google Scholar] [CrossRef]
- Srichaiyan, P.; Tippayawong, K.Y.; Boonprasope, A. Forecasting soybean futures prices with adaptive AI Models. IEEE Access 2025, 13, 48239–48256. [Google Scholar] [CrossRef]
- Patil, A.; Shah, D.; Shah, A.; Kotecha, R. Forecasting prices of agricultural commodities using machine learning for global food security: Towards sustainable development goal 2. Int. J. Eng. Trends Technol. 2023, 71, 277–291. [Google Scholar] [CrossRef]
- Jha, G.K.; Sinha, K. Agricultural price forecasting using neural network model: An innovative information delivery system. Agric. Econ. Res. Rev. 2013, 26, 229–239. [Google Scholar] [CrossRef]
- Nassar, L.; Okwuchi, I.E.; Saad, M.; Karray, F.; Ponnambalam, K.; Agrawal, P. Prediction of strawberry yield and farm price utilizing deep learning. In Proceedings of the International Joint Conference on Neural Networks (IJCNN), Glasgow, UK, 19–24 July 2020. [Google Scholar] [CrossRef]
- Haofei, Z.; Guoping, X.; Fangting, Y.; Han, Y. A neural network model based on the multi-stage optimization approach for short-term food price forecasting in China. Expert Syst. Appl. 2007, 33, 347–356. [Google Scholar] [CrossRef]
- Box, G.E.P.; Jenkins, G.M.; Reinsel, G.C. Time Series Analysis-Forecasting and Control, 3rd ed.; Prentice-Hall Inc.: Upper Saddle River, NJ, USA, 1994; ISBN 0-13-060774-6. [Google Scholar]
- Vapnik, V. The Nature of Statistical Learning Theory, 2nd ed.; Springer: Berlin/Heidelberg, Germany, 1995; ISBN 0-387-98780-0. [Google Scholar]
- Wang, Y.; Zhu, S.; Li, C. Research on multistep time series prediction based on LSTM. In Proceedings of the 2019 3rd International Conference on Electronic Information Technology and Computer Engineering (EITCE), Xiamen, China, 18–20 October 2019; IEEE Xplore: Piscataway, NJ, USA, 2019; pp. 1155–1159. [Google Scholar] [CrossRef]
- Gers, F.A.; Schmidhuber, J.; Cummins, F. Learning to Forget: Continual Prediction with LSTM. Neural Comput. 2000, 12, 2451–2471. [Google Scholar] [CrossRef]
- Gers, F.A.; Schraudolph, N.N.; Schmidhuber, J. Learning precise timing with LSTM recurrent networks. J. Mach. Learn. Res. 2002, 3, 115–143. Available online: https://www.jmlr.org/papers/v3/gers02a.html (accessed on 14 February 2025).
- Menculini, L.; Marini, A.; Proietti, M.; Garinei, A.; Bozza, A.; Moretti, C.; Marconi, M. Comparing prophet and deep learning to ARIMA in forecasting wholesale food prices. Forecasting 2021, 3, 644–662. [Google Scholar] [CrossRef]
- Paul, R.K.; Yeasin, M.; Kumar, P.; Kumar, P.; Balasubramanian, M.; Roy, H.S.; Paul, A.K.; Gupta, A. Machine learning techniques for forecasting agricultural prices: A case of brinjal in Odisha, India. PLoS ONE 2022, 17, e0270553. [Google Scholar] [CrossRef] [PubMed]
- Reddy, A.A. Price forecasting of tomatoes. Int. J. Veg. Sci. 2018, 25, 176–184. [Google Scholar] [CrossRef]
Sample (Time Series Period) | Study Objective | Deep Learning Approach | Evaluation Metric | Key Finding | References |
---|---|---|---|---|---|
Carrot, potato, oyster mushroom, eggplant, spiny cucumber, and celery (2009–2023) | To forecast daily prices of six distinct vegetables from wholesale markets in Beijing | LSTM, CNN, SVR, and XGB | R2, RMSE, MAPE, and MAE | The LSTM model demonstrated high generalization abilities and yielded highly accurate performance | Zhang et al. [3] |
Bur cucumber, oyster mushroom, cauliflower, knotted lettuce, and eggplant (2014–2024) | To compare the performance of LLM with a range of other price forecasting models for the daily price prediction of five different vegetables | SARIMA, Time-LLM, TimeMoE, N-BEATS, TiDE, PatchTST, and iTransformer | R2, RMSE, MAE, and PCC | The results showed LLM-based approaches outperform the others; however, VPF-MoE showed optimal performance | Zhao et al. [5] |
Tomato and chili (2009–2019) | To develop an application that can forecast the price of agricultural commodities for the benefit of farmers, traders, and end-users | ARIMA, LSTM, SVR, Prophet, and XGBt | MSE | The results show that LSTM is the most accurate and efficient in handling increasing amounts of complex data | Yuan and Ling [20] |
Tomato, onion, and potato (2006–2023) | To integrate HMM alongside other DL approaches for price forecasting analysis | HMM, MLP, RNN, GRUs, LSTM, and hybridized HM of all four DL methods | RMSE, MAPE, and MAE | A hybrid HMM -LSTM approach yielded superior forecasting performance compared to existing models | Avinash et al. [22] |
Cabbage, bok choi, watermelon, cauliflower, and strawberry (2011–2015) | To predict the price of commodities at a fresh produce market | ARIMA, SVM, GB, ANN, LSTM, CNN, and CNN-LSTM | R2, MAPE, MAE, and RMSE | The study reported ATT-CNN-LSTM to have the best performance in price prediction compared to ML and simple DL | Nassar et al. [23] |
Strawberry fruit (2006–2019) | To predict future prices of strawberries in FP using weather, yield, price, and sale data | ATT-CNN-LSTM, ATT-ConvLSTM, and SVR | AGM, R2, MAE, and MSE | The authors reported both ATT-CNN-LSTM and ATT-ConvLSTM as the two best- performing models compared to the rest | Okwuchi [24] |
Banana (2009–2019) | To forecast the price of bananas for the benefit of farmers, traders, and end-users | ARIMA, SARIMA, ARCH, GARCH, ANN, and RNN | MAPE, RMSE, SMAPE, MASE, and MDA | The RNN outperforms other models in the study in predicting accurate prices when compared to various statistical and machine learning techniques | Kumari et al. [25] |
Soybean (2020–2024) | To compare different ML algorithms for optimal prediction performance | Gradient Boosting, RF, DT, SVR, ANN, ElasticNet, SARIMAX, ARIMAX, and LSTM | MAPE | Gradient Boosting was found to outperform all the other models compared | Srichaiyan et al. [26] |
Millet, sorghum, and maize (2005–2022) | To forecast global prices of agricultural commodities | ARIMA, SARIMA, SVR, XGB, LSTM, and SARIMA-LSTM | MAPE | SARIMA and LSTM have a MAPE between 4.31 and 7.83% and demonstrate promising results as compared to ARIMA, SVR, and XGB | Patil et al. [27] |
Soybean and rapeseed(1980–2010) | To explore integrated linear and nonlinear price data trend for accurate forecasting | ARIMA, TDNN, and hybrid | RMSE and MAD | Results showed that ANN models captured better price trend compared to the linear models | Jha and Sinha [28] |
Strawberry (2006–2019) | To incorporate both yield data and a weather dataset for fresh produce price prediction and forecasting | LSTM, CNN, CNN-LSTM, and ATT-CNN-LSTM | MAE, RMSE, and R2 | The ATT-CNN-LSTM model is found to be the winning model since it outperforms the rest of the deployed ML and DL methods | Nassar et al. [29] |
Parameter | Value (ZAR/kg) |
---|---|
Mean | 5.2861 |
Minimum | 2.4560 |
Maximum | 10.6725 |
StdDev | 1.6638 |
Skewness | 0.5522 |
Kurtosis | 3.0408 |
First quartile | 3.8840 |
Second quartile | 5.1040 |
Third quartile | 6.4458 |
ADF Test | Test Statistic | p-Value | Critical Value | Conclusion |
---|---|---|---|---|
Original price | −0.2690 | 0.9298 | −2.8862 | Non-stationary |
Price after differencing (d = 1) | −5.6256 | 0.000001 | −3.4865 | Stationary |
Model | RMSE | MAE | MAPE (%) |
---|---|---|---|
ARIMA | 3.0576 | 2.5127 | 28.63 |
SARIMA | 0.9738 | 0.6564 | 7.66 |
SVR | 1.8535 | 1.4089 | 16.44 |
XGB | 1.7637 | 1.3184 | 15.38 |
LSTM | 0.2818 | 0.1925 | 2.42 |
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. |
© 2025 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Okere, E.E.; Balyan, V. A Deep Learning-Based Prediction and Forecasting of Tomato Prices for the Cape Town Fresh Produce Market: A Model Comparative Analysis. Forecasting 2025, 7, 19. https://doi.org/10.3390/forecast7020019
Okere EE, Balyan V. A Deep Learning-Based Prediction and Forecasting of Tomato Prices for the Cape Town Fresh Produce Market: A Model Comparative Analysis. Forecasting. 2025; 7(2):19. https://doi.org/10.3390/forecast7020019
Chicago/Turabian StyleOkere, Emmanuel Ekene, and Vipin Balyan. 2025. "A Deep Learning-Based Prediction and Forecasting of Tomato Prices for the Cape Town Fresh Produce Market: A Model Comparative Analysis" Forecasting 7, no. 2: 19. https://doi.org/10.3390/forecast7020019
APA StyleOkere, E. E., & Balyan, V. (2025). A Deep Learning-Based Prediction and Forecasting of Tomato Prices for the Cape Town Fresh Produce Market: A Model Comparative Analysis. Forecasting, 7(2), 19. https://doi.org/10.3390/forecast7020019