Computer Engineering and Applications ›› 2022, Vol. 58 ›› Issue (9): 294-302.DOI: 10.3778/j.issn.1002-8331.2112-0006

• Engineering and Applications • Previous Articles     Next Articles

Forecasting Stock Prices with Combined RMSE Loss LSTM-CNN Model

FANG Yiqiu, LU Zhuang, GE Junwei   

  1. School of Computer Science and Technology, Chongqing University of Posts and Telecommunications, Chongqing 400065, China
  • Online:2022-05-01 Published:2022-05-01



  1. 重庆邮电大学 计算机科学与技术学院,重庆 400065

Abstract: Due to the complexity and variability of the financial market, the current model cannot yet fully cover all aspects of the factors affecting stock trends, and there is still room for improvement in terms of forecast accuracy. Based on this, a method of combining RMSE loss LSTM-CNN(long short-term memory-convolutional neural networks) is proposed. This method innovatively intends to combine the RMSE loss function of the two models, fusing the advantages of LSTM to learn long-term time series dependencies and the advantages of CNN to extract deep features in the data. On the training data side, the same data is divided into two different manifestations, that is, stock time series data and stock image data, so that each branch in the joint model can maximize the effect. In order to prove the feasibility of the model, BP(back propagation), LSTM, CNN and LSTM-CNN fusion models are established for comparison. Through the experimental results on the three data sets of Shanghai Pudong Development Bank, Shanghai Shenzhen 300 Index and Shanghai Composite Index, the proposed combined RMSE loss LSTM-CNN model has good feasibility and universality in the prediction effect.

Key words: neural networks, deep learning, long short-term memory(LSTM), convolutional neural networks(CNN), stock forecasting

摘要: 由于金融市场的复杂性和多变性,当前模型尚不能完全覆盖股票走势影响因素的方方面面,在预测精度方面还存在改进空间。基于此,提出了一种联合RMSE损失LSTM-CNN(long short-term memory-convolutional neural networks)的方法。该方法创新性地通过联合两个模型的RMSE损失函数,融合了LSTM学习长期时间序列依存关系的优点和CNN提取数据中深层特征的优点。在训练数据端通过将同一数据分为两种不同的表现形式,即股票时序数据和股票图像数据,使联合模型中的每个分支发挥最大的作用。为了证明该模型的可行性,建立BP(back propagation)、LSTM、CNN和LSTM-CNN融合模型作为对比。通过浦发银行、沪深300指数和上证综指三个数据集上的实验结果,得出所提联合RMSE损失LSTM-CNN模型,在预测效果上具有良好的可行性和普适性的结论。

关键词: 神经网络, 深度学习, LSTM模型, CNN模型, 股票预测