A Stock Market Price Prediction Model Integrating a CNN–Transformer Dual-Channel Dynamic Attention Architecture
Chengcheng Han, Jingwei Guo, Xingyu FengStock market price prediction remains a persistent challenge owing to the non-stationarity, high noise content, and intricate spatiotemporal dependencies that characterize financial time series. Existing approaches typically excel at either local pattern extraction or long-range dependency modeling, yet seldom reconcile both within a unified framework. This paper introduces a CNN–Transformer dual-channel architecture equipped with a dynamic attention fusion module for stock price forecasting. The convolutional channel applies hierarchical dilated convolutions to distill fine-grained local patterns from multi-indicator sequences while suppressing high-frequency noise. Simultaneously, the Transformer channel employs multi-head self-attention to capture long-distance temporal correlations and regime-shift dynamics. A learnable gating mechanism then fuses the two feature streams by adaptively weighting local detail against global trend information according to market conditions. Experiments conducted on four real-world stock datasets spanning the S&P 500, CSI 300, NASDAQ Composite, and Hang Seng Index show that the proposed model reduces mean absolute error by 9.7–15.3% and root mean square error by 9.5–13.8% relative to competitive baselines including LSTM, CNN–LSTM, Informer, and PatchTST. Ablation studies further indicate that both channels and the fusion module contribute to prediction accuracy, and the architecture remains effective across markets with differing volatility profiles.