基于注意力机制融合TCN和LSTM的股价预测方法——以中国银行(601988)为例
Stock Price Prediction Based on Attention-Fused TCN and LSTM—Taking Bank of China (601988) as an Example
DOI: 10.12677/ecl.2025.144931, PDF,   
作者: 徐 赫, 宋瑾钰*:浙江理工大学计算机科学与技术学院(人工智能学院),浙江 杭州
关键词: Python时间卷积网络长短期记忆神经网络注意力机制股价预测Python TCN LSTM Attention Mechanism Stock Price Prediction
摘要: 随着我国金融市场的不断深化与发展,股票价格的波动预测成为投资者和研究者关注的焦点。本文以中国银行(601988)为研究对象,使用Python爬取英为财经网站上的股价数据。在此基础上,提出了一种基于注意力机制融合时间卷积网络(TCN)和长短期记忆网络(LSTM)的股价预测模型。通过对中国银行股票的开盘价格进行训练与预测,本文所提出的模型在预测精度上优于传统的ARIMA模型和单一的LSTM模型。实验结果显示,注意力机制融合TCN + LSTM模型在预测误差和损失函数MSE上均表现出较好的性能,尤其在处理股票价格的极值点和长期趋势方面具有显著优势。本研究不仅为股票投资者提供了有效的预测工具,也为金融时间序列分析领域提供了新的研究视角。
Abstract: As China’s financial market continues to deepen and evolve, forecasting stock price fluctuations has become a focal point for both investors and researchers. In this study, China Bank (601988) is selected as the case study, and stock price data is collected using Python from the Investing.com website. Building on this foundation, we propose a novel stock price prediction model that integrates features from a Temporal Convolutional Network (TCN) and a Long Short-Term Memory (LSTM) network through an Attention Mechanism. By training and forecasting the opening prices of China Bank’s stocks, our results demonstrate that the proposed model achieves higher prediction accuracy than both the traditional ARIMA model and the standalone LSTM model. Experimental outcomes further indicate that the attention-fused TCN + LSTM model outperforms in terms of prediction error and Mean Squared Error (MSE), particularly excelling in capturing extreme price fluctuations and long-term trends. This study not only provides a valuable predictive tool for investors but also offers a fresh perspective for financial time series analysis.
文章引用:徐赫, 宋瑾钰. 基于注意力机制融合TCN和LSTM的股价预测方法——以中国银行(601988)为例[J]. 电子商务评论, 2025, 14(4): 637-645. https://doi.org/10.12677/ecl.2025.144931

参考文献

[1] 肖杰. 基于ARIMA与LSTM对股票价格的预测研究——以中信证券(600030)为例[J]. 电子商务评论, 2024, 13(4): 6072-6083. [Google Scholar] [CrossRef
[2] Fama, E.F. and French, K.R. (1992) The Cross-Section of Expected Stock Returns. The Journal of Finance, 47, 427-465. [Google Scholar] [CrossRef
[3] Chong, C.W., Ahmad, M.I. and Abdullah, M.Y. (1999) Performance of GARCH Models in Forecasting Stock Market Volatility. Journal of Forecasting, 18, 333-343. [Google Scholar] [CrossRef
[4] Kim, M. and Sayama, H. (2017) Predicting Stock Market Movements Using Network Science: An Information Theoretic Approach. Applied Network Science, 2, Article No. 35. [Google Scholar] [CrossRef] [PubMed]
[5] Vapnik, V. (2013) The Nature of Statistical Learning Theory. Springer Science & Business Media.
[6] 宋刚, 张云峰, 包芳勋, 等. 基于粒子群优化LSTM的股票预测模型[J]. 北京航空航天大学学报, 2019, 45(12): 2533-2542.
[7] 史建楠, 邹俊忠, 张见, 等. 基于DMD-LSTM 模型的股票价格时间序列预测研究[J]. 计算机应用研究, 2020, 37(3): 662-666.
[8] 韩金磊, 熊萍萍, 孙继红. 基于LSTM和灰色模型的股价时间序列预测研究[J]. 南京信息工程大学学报, 2023, 15(6): 631-642.
[9] 王文姣, 张娜. 基于LSTM变权组合模型的股价预测[J]. 商展经济, 2023(7): 95-97.
[10] Zhou, J., Cui, G., Hu, S., Zhang, Z., Yang, C., Liu, Z., et al. (2020) Graph Neural Networks: A Review of Methods and Applications. AI Open, 1, 57-81. [Google Scholar] [CrossRef
[11] Kipf, T.N. and Welling, M. (2016) Semi-Supervised Classification with Graph Convolutional Networks.
[12] Sonani, M.S., Badii, A. and Moin, A. (2025) Stock Price Prediction Using a Hybrid LSTM-GNN Model: Integrating Time-Series and Graph-Based Analysis.
[13] Tian, H., Zheng, X., Zhao, K., Liu, M.W. and Zeng, D.D. (2022) Inductive Representation Learning on Dynamic Stock Co-Movement Graphs for Stock Predictions. INFORMS Journal on Computing, 34, 1940-1957. [Google Scholar] [CrossRef
[14] Shi, Y., Wang, Y., Qu, Y. and Chen, Z. (2023) Integrated GCN-LSTM Stock Prices Movement Prediction Based on Knowledge-Incorporated Graphs Construction. International Journal of Machine Learning and Cybernetics, 15, 161-176. [Google Scholar] [CrossRef
[15] Zhang, J. and Lei, Y. (2022) Deep Reinforcement Learning for Stock Prediction. Scientific Programming, 2022, 1-9. [Google Scholar] [CrossRef
[16] Bai, S., Kolter, J.Z. and Koltun, V. (2018) An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling.
[17] Hochreiter, S. and Schmidhuber, J. (1997) Long Short-Term Memory. Neural Computation, 9, 1735-1780. [Google Scholar] [CrossRef] [PubMed]
[18] Li, Y., Zeng, J., Shan, S. and Chen, X. (2019) Occlusion Aware Facial Expression Recognition Using CNN with Attention Mechanism. IEEE Transactions on Image Processing, 28, 2439-2450. [Google Scholar] [CrossRef] [PubMed]
[19] Pan, X., Ge, C., Lu, R., Song, S., Chen, G., Huang, Z., et al. (2022) On the Integration of Self-Attention and Convolution. 2022 IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR), New Orleans, 18-24 June 2022, 805-815. [Google Scholar] [CrossRef