Stock price prediction based on GAF and enhanced dual-branch CNN model
摘要
To address the inherent difficulty of forecasting stock prices, this study proposes a hybrid prediction model that integrates Gramian angular fields (GAF), convolutional neural networks (CNNs), bidirectional long short-term memory (BiLSTM), and an attention mechanism. Using daily trading data from multiple representative stocks in the Shanghai and Shenzhen markets from 2010 to 2024, the model first transforms one-dimensional stock information series into two-dimensional images via GAF, preserving their temporal structure and volatility patterns. A parallel CNN architecture is then constructed to extract spatial features from both the Gramian angular sum field (GASF) and Gramian angular difference field (GADF) representations. At the same time, BiLSTM networks are employed to capture deeper temporal dynamics. An attention mechanism is further incorporated to emphasize informative features dynamically. The final predictions are generated through fully connected layers. Empirical results show that the proposed model significantly outperforms traditional benchmarks and deep learning architectures. Furthermore, the integration of advanced evaluation metrics and statistical diagnostics confirms the model’s superior capability in tracking market momentum and ensuring forecast reliability.