A deep learning model using convolutional neural networks and conditional generative adversarial networks with multi-head attention for stock prediction

Stock prediction utilizing machine learning and deep learning models has attracted increasing attention in recent years. While recent research has made substantial progress in stock forecasting, many existing models perform inconsistently across markets and are sensitive to random initialization settings, which raises concerns about their robustness, generalizability, and practical applications. To address these issues, we propose ATTention-integrated Convolutional Neural Network-based Conditional Generative Adversarial Network (ATTCNN-CGAN), which leverages real historical samples as inputs to the generator, enabling more deterministic forecasting. Moreover, conventional generative adversarial networks (GANs) often employ recurrent generators that rely on sequential hidden state propagation, which can lead to longer gradient paths and may complicate adversarial optimization. Our approach utilizes convolutional neural networks (CNNs) for both the generator and the discriminator, which avoids the recurrent state propagation and extracts local temporal patterns in parallel, thereby enhancing training stability. Experiments on nine US large-cap stocks, conducted across multiple input lengths and random seeds, demonstrate that ATTCNN-CGAN achieves improved mean predictive performance compared to strong baselines under the tested configurations and exhibits more consistent performance across stocks. Furthermore, ablation studies suggest that the multi-head attention feature extraction, enhanced by the innovative dual-average aggregation strategy, boosts optimized feature representations and the forecasting performance. The findings highlight the potential of multi-head attention enhanced with diverse aggregation strategies for time-series forecasting.

Authors

Institutions

Publication Details

Journal
PeerJ Computer Science
Published
2026-05-21
DOI
https://doi.org/10.7717/peerj-cs.3886
Primary Topic
Stock Market Forecasting Methods
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A deep learning model using convolutional neural networks and conditional generative adversarial networks with multi-head attention for stock prediction

Zhiqi Wang, Feng Gu
PeerJ Computer Science
Stock Market Forecasting Methods
article

A deep learning model using convolutional neural networks and conditional generative adversarial networks with multi-head attention for stock prediction

Zhiqi Wang, Feng Gu
article en

Abstract

Stock prediction utilizing machine learning and deep learning models has attracted increasing attention in recent years. While recent research has made substantial progress in stock forecasting, many existing models perform inconsistently across markets and are sensitive to random initialization settings, which raises concerns about their robustness, generalizability, and practical applications. To address these issues, we propose ATTention-integrated Convolutional Neural Network-based Conditional Generative Adversarial Network (ATTCNN-CGAN), which leverages real historical samples as inputs to the generator, enabling more deterministic forecasting. Moreover, conventional generative adversarial networks (GANs) often employ recurrent generators that rely on sequential hidden state propagation, which can lead to longer gradient paths and may complicate adversarial optimization. Our approach utilizes convolutional neural networks (CNNs) for both the generator and the discriminator, which avoids the recurrent state propagation and extracts local temporal patterns in parallel, thereby enhancing training stability. Experiments on nine US large-cap stocks, conducted across multiple input lengths and random seeds, demonstrate that ATTCNN-CGAN achieves improved mean predictive performance compared to strong baselines under the tested configurations and exhibits more consistent performance across stocks. Furthermore, ablation studies suggest that the multi-head attention feature extraction, enhanced by the innovative dual-average aggregation strategy, boosts optimized feature representations and the forecasting performance. The findings highlight the potential of multi-head attention enhanced with diverse aggregation strategies for time-series forecasting.

PeerJ Computer ScienceVol. 12
The Graduate Center, CUNY (US), College of Staten Island (US), City University of New York (US)
Reduced inequalities
Openalex Percentile: Top 4%
Stock Market Forecasting Methods
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.