Gold Price Prediction Using a Hybrid Convolutional-Recurrent Neural Network (CNN-GRU)

Document Type : Research Paper

Authors

1 Department of Computer Engineering, Shahid Bahonar University of Kerman, Iran.

2 Department of Economics, Shahid Bahonar University of Kerman, Iran.

Abstract

Gold, as a highly valuable asset, experiences frequent price fluctuations due to economic, political, and supply-demand factors, making accurate forecasting essential for investors and market analysts. A precise prediction model can help identify optimal buying and selling opportunities while minimizing financial risks. This study aims to develop a hybrid predictive model by integrating Convolutional Neural Networks (CNN) and Gated Recurrent Units (GRU) to enhance the accuracy of gold price forecasting. In this framework, CNN is employed to extract spatial features from historical price data, while GRU captures temporal dependencies, ensuring a more refined prediction. Gold price data from 2004 to 2023 was collected, preprocessed, and normalized before being divided into training and testing datasets. The proposed model was trained using this dataset to identify patterns and trends in gold price movements. Additionally, the implementation of multi-cycle models in the proposed methodology resulted in a 22–48% improvement in prediction accuracy compared to baseline hybrid recurrent models (CNN-LSTM and CNN-BiLSTM) implemented in this study. The experimental results demonstrate that the CNN-GRU model outperforms these alternatives in terms of forecasting precision. Moreover, the proposed hybrid approach exhibits strong generalization capabilities, making it applicable to other financial time series forecasting problems. These findings highlight the effectiveness of combining CNN and GRU in predictive modeling, providing a valuable tool for investors and analysts in making informed financial decisions. The novelty of this study lies in the introduction of a new hybrid CNN-GRU model, applied for the first time specifically for gold price forecasting.

Keywords

Main Subjects


Article Title [Persian]

پیش‌یبنی قیمت طلا به کمک شبکه‌ی عصبی ترکیبی کانولوشنال-بازگشتی

Authors [Persian]

  • فاطمه ایزدی بیدانی 1
  • وحید ستاری نائینی 1
  • زین العابدین صادقی 2
  • امید عابدی 1
1 دانشکده مهندسی کامپیوتر، دانشگاه شهید باهنر، کرمان، ایران.
2 دانشکده اقتصاد، دانشگاه شهید باهنر، کرمان، ایران.
Abstract [Persian]

طلا به‌عنوان یک دارایی بسیار ارزشمند، به دلیل عوامل اقتصادی، سیاسی و عرضه و تقاضا دچار نوسانات قیمتی مکرر می‌شود و این امر پیش‌بینی دقیق آن را برای سرمایه‌گذاران و تحلیلگران بازار ضروری می‌سازد. یک مدل پیش‌بینی دقیق می‌تواند به شناسایی بهترین فرصت‌های خرید و فروش کمک کرده و ریسک‌های مالی را به حداقل برساند. هدف این پژوهش، توسعه یک مدل ترکیبی پیش‌بینی با ادغام شبکه‌های عصبی کانولوشنی (CNN) و واحدهای بازگشتی دروازه‌ای (GRU) به‌منظور افزایش دقت پیش‌بینی قیمت طلا است. در این چارچوب، CNN برای استخراج ویژگی‌های مکانی از داده‌های تاریخی قیمت به‌کار گرفته شده و GRU وابستگی‌های زمانی را ثبت می‌کند تا پیش‌بینی دقیق‌تری حاصل شود. داده‌های قیمت طلا از سال 2004 تا 2023 جمع‌آوری، پیش‌پردازش و نرمال‌سازی شده و سپس به مجموعه‌های آموزش و آزمون تقسیم گردید. مدل پیشنهادی با استفاده از این داده‌ها آموزش داده شد تا الگوها و روندهای تغییر قیمت شناسایی گردد. علاوه بر این، به‌کارگیری مدل‌های چند چرخه در روش پیشنهادی موجب بهبود 22 تا 48 درصدی دقت پیش‌بینی در مقایسه با مدل‌های ترکیبی بازگشتی پایه (CNN-LSTM و CNN-BiLSTM) شد. نتایج آزمایش‌ها نشان داد مدل CNN-GRU از نظر دقت پیش‌بینی عملکرد بهتری نسبت به رقبا دارد. افزون بر این، رویکرد ترکیبی پیشنهادی از قابلیت تعمیم بالایی برخوردار بوده و می‌تواند در سایر مسائل پیش‌بینی سری‌های زمانی مالی نیز به‌کار گرفته شود. نوآوری اصلی این پژوهش، معرفی مدل ترکیبی جدید CNN-GRU است که برای نخستین بار به‌طور ویژه در پیش‌بینی قیمت طلا مورد استفاده قرار گرفته است.

Keywords [Persian]

  • شبکه عصبی کانولوشنی (CNN)
  • شبکه‌های واحد بازگشتی دروازه‌دار (GRU)
  • قیمت طلا
  • یادگیری ماشین
Abu-Doush, I., Ahmed, B., Awadallah, M. A., Al-Betar, M. A., & Rababaah, A. R. (2023). Enhancing multilayer perceptron neural network using archive-based harris hawks optimizer to predict gold prices. Journal of King Saud University – Computer and Information Sciences, 35(9), 101557. https://doi.org/10.1016/j.jksuci.2023.101557.
Alameer, Z., Abd Elaziz, M., Ewees, A. A., Ye, H., & Jianhua, Z. (2019). Forecasting gold price fluctuations using improved multilayer perceptron neural network and whale optimization algorithm. Resources Policy, 61, 250–260. https://doi.org/10.1016/j.resourpol.2019.02.014 .
Amini, A., & Kalantari, R. (2023). Gold price prediction by a CNN-Bi-LSTM model along with automatic parameter tuning. AUT Journal of Modeling and Simulation, 50(1), 71–82. https://doi.org/10.22060/miscj.2018.13508.5074 .
Baradaran, A. H., Bohlouli, M., & Jahed Motlagh, M. R. (2023). Decoding tomorrow's gold prices: A comparative study of GRU and CNN-LSTM in the Iranian market. Applied Soft Computing, 140, 110–125. https://doi.org/10.1016/j.asoc.2023.110325 .
Ben Jabeur, S., Mefteh-Wali, S., & Viviani, J.-L. (2021). Forecasting gold price with the XGBoost algorithm and SHAP interaction values. International Review of Financial Analysis, 78, 101976. https://doi.org/10.1016/j.irfa.2021.101976 .
Chung, J., Gulcehre, C., Cho, K., & Bengio, Y. (2014). Empirical evaluation of gated recurrent neural networks on sequence modeling. arXiv preprint arXiv:1412.3555. https://doi.org/10.48550/arXiv.1412.3555 .
Cohen, G., & Aiche, A. (2023). Forecasting gold price using machine learning methodologies. Journal of Commodity Markets, 30, 100–115. https://doi.org/10.1016/j.jcomm.2023.100115 .
Dewi, N. P. J. R., Indrawan, I. G. A., Ginantra, N. L. W. S. R., & Darma, I. W. A. S. (2022). Application of long short-term memory (LSTM) and gated recurrent unit (GRU) algorithm in gold price prediction. International Journal of Intelligent Systems and Applications, 14(4), 45–58. https://doi.org/10.5815/ijisa.2022.04.05 .
Dhuhita, W. M. P., Haryoko, Farid, M. F. A., Huda, A. A., & Yaqin, A. (2022). Gold price prediction based on Yahoo finance data using LSTM algorithm. Journal of Physics: Conference Series, 2157(1), 012038. https://doi.org/10.1088/1742-6596/2157/1/012038 .
E, J., Ye, J., & Jin, H. (2023). A novel hybrid model on the prediction of time series and its application for the gold price analysis and forecasting. Knowledge-Based Systems, 278, 110–125. https://doi.org/10.1016/j.knosys.2023.110876 .
Ghute, M., & Korde, M. (2021). Efficient machine learning algorithm for future gold price prediction. International Journal of Engineering and Advanced Technology, 10(5), 78–85. https://doi.org/10.35940/ijeat.E3064.0510521 .
Gong, W. (2022). Research on gold price forecasting based on LSTM and linear regression. Journal of Physics: Conference Series, 2189(1), 012015. https://doi.org/10.1088/1742-6596/2189/1/012015 .
Hafezi, R., & Akhavan, A. N. (2018). Forecasting gold price changes: Application of an equipped artificial neural network. AUT Journal of Modeling and Simulation, 50(1), 71–82. https://doi.org/10.22060/miscj.2018.13508.5074 .
Hajek, P., & Novotny, J. (2021). Fuzzy rule-based prediction of gold prices using news affect. International Journal of Information Management, 58, 102–115. https://doi.org/10.1016/j.ijinfomgt.2021.102415 .
Hosseinpour, M. J., & Jahan, M. H. (2023). Gold price forecasting based on hybrid methods of deep learning and Shahin Harris. In Proceedings of the 7th International Conference on Global Studies in Computer, Electrical and Mechanical Engineering (pp. 112–118). IEEE. https://doi.org/10.1109/GSCEEM57105.2023.10152467 .
Jaiswal, R., & Singh, B. (2022). A hybrid convolutional recurrent (CNN-GRU) model for stock price prediction. International Journal of Pattern Recognition and Artificial Intelligence. Advance online publication. https://doi.org/10.1142/S021800142350015X .
Jovanovic, A., Dogandzic, T., Dobrojevic, M., Sarac, M., Bacanin, N., & Zivkovic, M. (2023). Gold prices forecasting using recurrent neural network with attention tuned by metaheuristics. Expert Systems with Applications, 215, 119–132. https://doi.org/10.1016/j.eswa.2023.119324 .
Liang, Y., Lin, Y., & Lu, Q. (2023). Forecasting gold price using a novel hybrid model with ICEEMDAN and LSTM-CNN-CBAM. Engineering Applications of Artificial Intelligence, 120, 105–120. https://doi.org/10.1016/j.engappai.2023.105912 .
Livieris, I. E., Pintelas, E., & Pintelas, P. (2020). A CNN–LSTM model for gold price time-series forecasting. Neural Computing and Applications, 32(23), 17351–17360. https://doi.org/10.1007/s00521-020-04867-x .
Mamipour, S., & Vaezi Jezeie, F. (2014). Non-linear relationships among oil price, gold price and stock market returns in Iran: A multivariate regime-switching approach. Energy Economics, 45, 285–297. https://doi.org/10.1016/j.eneco.2014.08.001 .
Mohsin, M., & Jamaani, F. (2022). A novel deep-learning technique for forecasting oil price volatility using historical prices of five precious metals in context of green financing. Resources Policy, 79, 102–115. https://doi.org/10.1016/j.resourpol.2022.102876 .
Nanthiya, D., Gopal, S. B., Balakumar, S., Harisankar, M., & Midhun, S. P. (2021). Gold price prediction using ARIMA model. Materials Today: Proceedings, 47, 5122–5128. https://doi.org/10.1016/j.matpr.2021.05.445 .
Payandeh Najafabadi, A. T., Qazvini, M., & Ofoghi, R. (2012). The impact of oil and gold prices’ shock on Tehran Stock Exchange: A copula approach. Iranian Journal of Economic Studies, 1(2), 23–47.
Rezazadeh, A., & Mohseninia, R. (2019). The impact of financial stress on the Iranian gold, currency and stock markets: A time-varying Granger-causality approach. Journal of International Financial Markets, Institutions and Money, 63, 101–115. https://doi.org/10.1016/j.intfin.2019.101142 .
Shafiee, S., & Topal, E. (2010). An overview of global gold market and gold price forecasting. Resources Policy, 35(3), 178–189. https://doi.org/10.1016/j.resourpol.2010.05.004 .
Singh, U., Saurabh, K., Trehan, N., Vyas, R., & Vyas, O. P. (2024). GA-LSTM: Performance optimization of LSTM driven time series forecasting. Applied Soft Computing. Advance online publication. https://doi.org/10.1016/j.asoc.2023.110456 .
Song, Y., Huang, J., Xu, Y., Ruan, J., & Zhu, M. (2023). Multi-decomposition in deep learning models for futures price prediction. Resources Policy, 83, 103–118. https://doi.org/10.1016/j.resourpol.2023.103621 .
Stankovic, M., Bacanin, N., Budimirovic, N., Zivkovic, M., Sarac, M., & Ivana. (2023). Bi-directional long short-term memory optimization by improved teaching-learning based algorithm for univariate gold price forecasting. Expert Systems with Applications, 215, 119–132. https://doi.org/10.1016/j.eswa.2023.119324 .
Vidal, A., & Kristjanpoller, W. (2023). Gold volatility prediction using a CNN-LSTM approach. International Review of Economics & Finance, 87, 102–115. https://doi.org/10.1016/j.iref.2023.102345 .
Wagenaar, T. (n.d.). GRU - Built-ins. Neataptic. Retrieved October 26, 2023, from https://wagenaartje.github.io/neataptic/docs/builtins/gru/ .
Wang, H., Zhang, Y., Liang, J., & Liu, L. (2022). DAFA-BiLSTM: Deep autoregression feature augmented bidirectional LSTM network for time series prediction. Knowledge-Based Systems, 243, 108–125. https://doi.org/10.1016/j.knosys.2022.108456 .
Yurtsever, M. (2021). Gold price forecasting using LSTM, Bi-LSTM and GRU. European Journal of Science and Technology, (31), 341–347.