Improving Deep Learning Models by Bayesian Optimization to Predict Crude Oil Prices
Abstract
1. Introduction
2. Materials and Methods
2.1. Convolutional Neural Networks
2.2. Long Short-Term Memory Neural Networks
2.3. Gated Recurrent Units
2.4. Recurrent Neural Networks
2.5. Bayesian Optimization
2.6. Performance Measures
3. Results
3.1. WTI Sampling and Forecasting Results
3.2. Brent Sampling and Forecasting Results
4. Discussion and Conclusions
Author Contributions
Funding
Data Availability Statement
Conflicts of Interest
Abbreviations
| BO | Bayesian optimization |
| CNN | Convolutional neural network |
| GRU | Gated recurrent unit |
| LSTM | Long short-term memory |
| MAD | Mean absolute deviation |
| MAPE | Mean absolute percentage error |
| RMSE | Root mean of squared errors |
| RNN | Recurrent neural network |
References
- Moshiri, S.; Foroutan, F. Forecasting Nonlinear Crude Oil Futures Prices. Energy J. 2006, 27, 81–96. [Google Scholar] [CrossRef]
- Gao, W.; Aamir, M.; Shabri, A.B.; Dewan, R.; Aslam, A. Forecasting Crude Oil Price Using Kalman Filter Based on the Reconstruction of Modes of Decomposition Ensemble Model. IEEE Access 2019, 7, 149908–149925. [Google Scholar] [CrossRef]
- Wu, J.; Chen, Y.; Zhou, T.; Li, T. An Adaptive Hybrid Learning Paradigm Integrating CEEMD, ARIMA and SBL for Crude Oil Price Forecasting. Energies 2019, 12, 1239. [Google Scholar] [CrossRef]
- Marchese, M.; Kyriakou, I.; Tamvakis, M.; Di Iorio, F. Forecasting crude oil and refined products volatilities and correlations: New evidence from fractionally integrated multivariate GARCH models. Energy Econ. 2020, 88, 104757. [Google Scholar] [CrossRef]
- Alam, M.S.; Murshed, M.; Manigandan, P.; Pachiyappan, D.; Abduvaxitovna, S.Z. Forecasting oil, coal, and natural gas prices in the pre-and post-COVID scenarios: Contextual evidence from India using time series forecasting tools. Resour. Policy 2023, 81, 103342. [Google Scholar] [CrossRef] [PubMed]
- Guo, J.; Zhao, Z.; Sun, J.; Sun, S. Multi-perspective crude oil price forecasting with a new decomposition-ensemble framework. Resour. Policy 2022, 77, 102737. [Google Scholar] [CrossRef]
- Yu, L.; Xu, H.; Tang, L. LSSVR ensemble learning with uncertain parameters for crude oil price forecasting. Appl. Soft Comput. 2017, 56, 692–701. [Google Scholar] [CrossRef]
- Zhang, T.; Tang, Z.; Wu, J.; Du, X.; Chen, K. Multi-step-ahead crude oil price forecasting based on two-layer decomposition technique and extreme learning machine optimized by the particle swarm optimization algorithm. Energy 2021, 229, 120797. [Google Scholar] [CrossRef]
- Wang, J.; Zhou, H.; Hong, T.; Li, X.; Wang, S. A multi-granularity heterogeneous combination approach to crude oil price forecasting. Energy Econ. 2020, 91, 104790. [Google Scholar] [CrossRef]
- Zhang, Y.; Lahmiri, S. A Deep Learning-Based Ensemble System for Brent and WTI Crude Oil Price Analysis and Prediction. Entropy 2025, 27, 1122. [Google Scholar] [CrossRef]
- Niu, T.; Wang, J.; Lu, H.; Yang, W.; Du, P. A Learning System Integrating Temporal Convolution and Deep Learning for Predictive Modeling of Crude Oil Price. IEEE Trans. Ind. Inform. 2021, 17, 4602–4612. [Google Scholar] [CrossRef]
- Busari, G.A.; Lim, D.H. Crude oil price prediction: A comparison between AdaBoost-LSTM and AdaBoost-GRU for improving forecasting performance. Comput. Chem. Eng. 2021, 155, 107513. [Google Scholar] [CrossRef]
- Karasu, S.; Altan, A. Crude oil time series prediction model based on LSTM network with chaotic Henry gas solubility optimization. Energy 2022, 242, 122964. [Google Scholar] [CrossRef]
- Sen, A.; Dutta Choudhury, K. Forecasting the Crude Oil prices for last four decades using deep learning approach. Resour. Policy 2024, 88, 104438. [Google Scholar] [CrossRef]
- Cen, Z.; Wang, J. Crude oil price prediction model with long short term memory deep learning based on prior knowledge data transfer. Energy 2019, 169, 160–171. [Google Scholar] [CrossRef]
- Nagendra Kumar, Y.J.; Preetham, P.; Kiran Varma, P.; Rohith, P.; Dilip Kumar, P. Crude Oil Price Prediction Using Deep Learning. In Proceedings of the 2020 Second International Conference on Inventive Research in Computing Applications (ICIRCA), Coimbatore, India, 15–17 July 2020; pp. 118–123. [Google Scholar] [CrossRef]
- Mohsin, M.; Jamaani, F. A novel deep-learning technique for forecasting oil price volatility using historical prices of five precious metals in context of green financing—A comparison of deep learning, machine learning, and statistical models. Resour. Policy 2023, 86, 104216. [Google Scholar] [CrossRef]
- LeCun, Y.; Bengio, Y.; Hinton, G. Deep learning. Nature 2015, 521, 436–444. [Google Scholar] [CrossRef]
- Hochreiter, S.; Schmidhuber, J. Long short-term memory. Neural Comput. 1997, 9, 1735–1780. [Google Scholar] [CrossRef]
- Cho, K.; van Merriënboer, B.; Gulcehre, C.; Bahdanau, D.; Bougares, F.; Schwenk, H.; Bengio, Y. Learning phrase representations using RNN encoder-decoder for statistical machine translation. arXiv 2014, arXiv:1406.1078. [Google Scholar] [CrossRef]
- Elman, J.L. Finding structure in time. Cogn. Sci. 1990, 14, 179–211. [Google Scholar] [CrossRef]
- Gelbart, M.; Snoek, J.; Adams, R.P. Bayesian Optimization with Unknown Constraints. arXiv 2014, arXiv:1403.5607. [Google Scholar] [CrossRef]
- Available online: https://fred.stlouisfed.org/ (accessed on 21 September 2023).
- Lahmiri, S. Wavelet Entropy for Efficiency Assessment of Price, Return, and Volatility of Brent and WTI During Extreme Events. Commodities 2025, 4, 4. [Google Scholar] [CrossRef]
- Lahmiri, S. Price disorder and information content in energy and gold markets: The effect of the COVID-19 pandemic. Energy Nexus 2024, 16, 100343. [Google Scholar] [CrossRef]
- Lahmiri, S. Causality Between Brent and West Texas Intermediate: The Effects of COVID-19 Pandemic and Russia–Ukraine War. Commodities 2025, 4, 2. [Google Scholar] [CrossRef]
- Lahmiri, S. The nexus between fossil energy markets and the effect of the COVID-19 pandemic on clustering structures. Energy Nexus 2024, 16, 100344. [Google Scholar] [CrossRef]
- Tang, Y.; Gao, Z.; Li, Y.; Cai, Z.; Yu, J.; Qin, P. Crude Oil and Hot-Rolled Coil Futures Price Prediction Based on Multi-Dimensional Fusion Feature Enhancement. Algorithms 2025, 18, 357. [Google Scholar] [CrossRef]
- Ma, N.; Wang, Z.; Ba, Z.; Li, X.; Yang, N.; Yang, X.; Zhang, H. Hierarchical Reinforcement Learning for Crude Oil Supply Chain Scheduling. Algorithms 2023, 16, 354. [Google Scholar] [CrossRef]
- An, S. Dynamic Multiscale Information Spillover among Crude Oil Time Series. Entropy 2022, 24, 1248. [Google Scholar] [CrossRef]
- Fnu, N.; Bansal, A. Understanding the architecture of vision transformer and its variants: A review. In Proceedings of the 1st International Conference on Innovative Engineering Sciences and Technological Research (ICIESTR) 2024, Muscat, Oman, 14–15 May 2024; pp. 1–6. [Google Scholar] [CrossRef]



| Evaluation Metrics | WTI Daily Sampling Rate | |||||||
|---|---|---|---|---|---|---|---|---|
| CNN | RNN | LSTM | GRU | |||||
| Without BO | With BO | Without BO | With BO | Without BO | With BO | Without BO | With BO | |
| RMSE | 0.08518 | 0.08072 | 0.07892 | 0.07338 | 0.18784 | 0.0777 | 0.07671 | 0.07462 |
| MAD | 0.04424 | 0.04639 | 0.04338 | 0.04029 | 0.13301 | 0.04461 | 0.04355 | 0.0424 |
| MAPE | 29.06% | 32.20% | 27.75% | 25.75% | 50.97% | 32.14% | 32.63% | 28.61% |
| Evaluation Metrics | WTI Weekly Sampling Rate | |||||||
|---|---|---|---|---|---|---|---|---|
| CNN | RNN | LSTM | GRU | |||||
| Without BO | With BO | Without BO | With BO | Without BO | With BO | Without BO | With BO | |
| RMSE | 0.16538 | 0.12163 | 0.11364 | 0.06764 | 0.14179 | 0.13478 | 0.10912 | 0.09902 |
| MAD | 0.11613 | 0.08267 | 0.07858 | 0.07191 | 0.10199 | 0.099214 | 0.07583 | 0.07304 |
| MAPE | 53.37% | 38.98% | 52.14% | 27.85% | 49.55% | 34.85% | 50.79% | 38.28% |
| Evaluation Metrics | WTI Monthly Sampling Rate | |||||||
|---|---|---|---|---|---|---|---|---|
| CNN | RNN | LSTM | GRU | |||||
| Without BO | With BO | Without BO | With BO | Without BO | With BO | Without BO | With BO | |
| RMSE | 0.33162 | 0.11325 | 0.13872 | 0.07616 | 0.31002 | 0.25095 | 0.24242 | 0.23847 |
| MAD | 0.23227 | 0.16383 | 0.16821 | 0.06772 | 0.22913 | 0.17825 | 0.17573 | 0.18848 |
| MAPE | 56.16% | 46.00% | 46.06% | 29.82% | 50.36% | 37.36% | 50.07% | 35.73% |
| Evaluation Metrics | BRENT Daily Sampling Rate | |||||||
|---|---|---|---|---|---|---|---|---|
| CNN | RNN | LSTM | GRU | |||||
| Without BO | With BO | Without BO | With BO | Without BO | With BO | Without BO | With BO | |
| RMSE | 0.0668 | 0.05688 | 0.05792 | 0.05396 | 0.06837 | 0.05457 | 0.05412 | 0.05304 |
| MAD | 0.04412 | 0.03834 | 0.03864 | 0.03651 | 0.04792 | 0.04355 | 0.037 | 0.03585 |
| MAPE | 43.30% | 40.22% | 38.40% | 37.98% | 43.05% | 34.34% | 37.05% | 30.48% |
| Evaluation Metrics | BRENT Weekly Sampling Rate | |||||||
|---|---|---|---|---|---|---|---|---|
| CNN | RNN | LSTM | GRU | |||||
| Without BO | With BO | Without BO | With BO | Without BO | With BO | Without BO | With BO | |
| RMSE | 0.16253 | 0.10379 | 0.23467 | 0.10575 | 0.13512 | 0.10641 | 0.10667 | 0.07888 |
| MAD | 0.11734 | 0.07527 | 0.17599 | 0.07544 | 0.09656 | 0.07573 | 0.07602 | 0.0702 |
| MAPE | 54.01% | 40.80% | 55.00% | 33.76% | 55.57% | 36.17% | 44.66% | 25.95% |
| Evaluation Metrics | BRENT Monthly Sampling Rate | |||||||
|---|---|---|---|---|---|---|---|---|
| CNN | RNN | LSTM | GRU | |||||
| Without BO | With BO | Without BO | With BO | Without BO | With BO | Without BO | With BO | |
| RMSE | 0.13639 | 0.12742 | 0.05464 | 0.03467 | 0.16197 | 0.06279 | 0.03739 | 0.0315 |
| MAD | 0.2502 | 0.16888 | 0.03771 | 0.07599 | 0.14242 | 0.09332 | 0.07497 | 0.06136 |
| MAPE | 66.33% | 45.04% | 43.21% | 38.00% | 45.75% | 38.66% | 44.06% | 31.03% |
| Brent | WTI | |
|---|---|---|
| Average | 73.01 | 68.19 |
| Standard deviation | 19.26 | 18.54 |
| Kurtosis | 0.87 | 1.02 |
| Skewness | −0.14 | −0.14 |
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
Kachwaha, S.; Lahmiri, S. Improving Deep Learning Models by Bayesian Optimization to Predict Crude Oil Prices. Algorithms 2025, 18, 762. https://doi.org/10.3390/a18120762
Kachwaha S, Lahmiri S. Improving Deep Learning Models by Bayesian Optimization to Predict Crude Oil Prices. Algorithms. 2025; 18(12):762. https://doi.org/10.3390/a18120762
Chicago/Turabian StyleKachwaha, Shagun, and Salim Lahmiri. 2025. "Improving Deep Learning Models by Bayesian Optimization to Predict Crude Oil Prices" Algorithms 18, no. 12: 762. https://doi.org/10.3390/a18120762
APA StyleKachwaha, S., & Lahmiri, S. (2025). Improving Deep Learning Models by Bayesian Optimization to Predict Crude Oil Prices. Algorithms, 18(12), 762. https://doi.org/10.3390/a18120762
