{"status":"ok","message-type":"work","message-version":"1.0.0","message":{"indexed":{"date-parts":[[2026,5,21]],"date-time":"2026-05-21T09:11:25Z","timestamp":1779354685686,"version":"3.51.4"},"reference-count":50,"publisher":"PeerJ","license":[{"start":{"date-parts":[[2026,5,21]],"date-time":"2026-05-21T00:00:00Z","timestamp":1779321600000},"content-version":"unspecified","delay-in-days":0,"URL":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/"}],"content-domain":{"domain":[],"crossmark-restriction":false},"short-container-title":[],"abstract":"<jats:p>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.<\/jats:p>","DOI":"10.7717\/peerj-cs.3886","type":"journal-article","created":{"date-parts":[[2026,5,21]],"date-time":"2026-05-21T08:51:47Z","timestamp":1779353507000},"page":"e3886","source":"Crossref","is-referenced-by-count":0,"title":["A deep learning model using convolutional neural networks and conditional generative adversarial networks with multi-head attention for stock prediction"],"prefix":"10.7717","volume":"12","author":[{"given":"Zhiqi","family":"Wang","sequence":"first","affiliation":[{"name":"Department of Computer Science, City University of New York, Graduate School and University Center, New York, NY, United States"}],"role":[{"role":"author","vocabulary":"crossref"}]},{"ORCID":"https:\/\/orcid.org\/0000-0001-5337-4282","authenticated-orcid":true,"given":"Feng","family":"Gu","sequence":"additional","affiliation":[{"name":"Department of Computer Science, City University of New York, College of Staten Island, Staten Island, NY, United States"}],"role":[{"role":"author","vocabulary":"crossref"}]}],"member":"4443","published-online":{"date-parts":[[2026,5,21]]},"reference":[{"issue":"6","key":"10.7717\/peerj-cs.3886\/ref-1","doi-asserted-by":"publisher","first-page":"445","DOI":"10.32628\/IJSRCSEIT","article-title":"Integrating AI-driven risk assessment frameworks in financial operations: a model for enhanced corporate governance","volume":"9","author":"Adekunle","year":"2023","journal-title":"International Journal of Scientific Research in Computer Science, Engineering and Information Technology"},{"issue":"1","key":"10.7717\/peerj-cs.3886\/ref-2","doi-asserted-by":"publisher","first-page":"287","DOI":"10.32604\/cmc.2022.014637","article-title":"Stock prediction based on technical indicators using deep learning model","volume":"70","author":"Agrawal","year":"2022","journal-title":"Computers, Materials & Continua"},{"issue":"4","key":"10.7717\/peerj-cs.3886\/ref-3","doi-asserted-by":"publisher","first-page":"1813","DOI":"10.1007\/s41870-023-01260-4","article-title":"Stock price prediction using ARIMA versus XGBoost models: the case of the largest telecommunication company in the Middle East","volume":"15","author":"Almaafi","year":"2023","journal-title":"International Journal of Information Technology"},{"key":"10.7717\/peerj-cs.3886\/ref-4","doi-asserted-by":"publisher","first-page":"132964\u2013132971","DOI":"10.1109\/ACCESS.2024.3444699","article-title":"Emerging stock market prediction using GRU algorithm: incorporating endogenous and exogenous variables","volume":"12","author":"Alsheebah","year":"2024","journal-title":"IEEE Access"},{"key":"10.7717\/peerj-cs.3886\/ref-5","doi-asserted-by":"publisher","first-page":"106","DOI":"10.1109\/UKSim.2014.67","article-title":"Stock price prediction using the ARIMA model","author":"Ariyo","year":"2014"},{"key":"10.7717\/peerj-cs.3886\/ref-6","first-page":"214","article-title":"Wasserstein generative adversarial networks","author":"Arjovsky","year":"2017"},{"key":"10.7717\/peerj-cs.3886\/ref-7","doi-asserted-by":"publisher","DOI":"10.48550\/arXiv.2210.13393","article-title":"We need to talk about random seeds","author":"Bethard","year":"2022"},{"issue":"1","key":"10.7717\/peerj-cs.3886\/ref-8","doi-asserted-by":"publisher","first-page":"32","DOI":"10.1504\/IJDATS.2024.137465","article-title":"Analysis of machine learning\u2019s performance in stock market prediction, compared to traditional technical analysis indicators","volume":"16","author":"Bouasabah","year":"2024","journal-title":"International Journal of Data Analysis Techniques and Strategies"},{"issue":"1","key":"10.7717\/peerj-cs.3886\/ref-9","doi-asserted-by":"publisher","first-page":"16","DOI":"10.1007\/s10515-021-00303-z","article-title":"Convolutional neural network for stock trading using technical indicators","volume":"29","author":"Chandar","year":"2022","journal-title":"Automated Software Engineering"},{"key":"10.7717\/peerj-cs.3886\/ref-10","doi-asserted-by":"publisher","first-page":"340","DOI":"10.1016\/j.eswa.2017.02.044","article-title":"A feature weighted support vector machine and K-nearest neighbor algorithm for stock market indices prediction","volume":"80","author":"Chen","year":"2017","journal-title":"Expert Systems with Applications"},{"issue":"3","key":"10.7717\/peerj-cs.3886\/ref-11","doi-asserted-by":"publisher","first-page":"67","DOI":"10.1016\/j.ins.2020.12.068","article-title":"A novel graph convolutional feature based convolutional neural network for stock trend prediction","volume":"556","author":"Chen","year":"2021","journal-title":"Information Sciences"},{"issue":"3","key":"10.7717\/peerj-cs.3886\/ref-12","doi-asserted-by":"publisher","first-page":"114444","DOI":"10.1016\/j.eswa.2020.114444","article-title":"Forecasting daily stock trend using multi-filter feature selection and deep learning","volume":"168","author":"Haq","year":"2021","journal-title":"Expert Systems with Applications"},{"key":"10.7717\/peerj-cs.3886\/ref-13","doi-asserted-by":"publisher","DOI":"10.48550\/arXiv.1709.06560","article-title":"Deep reinforcement learning that matters","author":"Henderson","year":"2017"},{"issue":"8","key":"10.7717\/peerj-cs.3886\/ref-14","doi-asserted-by":"publisher","first-page":"1735","DOI":"10.1162\/neco.1997.9.8.1735","article-title":"Long short-term memory","volume":"9","author":"Hochreiter","year":"1997","journal-title":"Neural Computation"},{"key":"10.7717\/peerj-cs.3886\/ref-15","article-title":"Geopolitical risks and their impact on global macro-financial stability: literature and measurements (No. 9\/2024)","author":"Hodula","year":"2024","journal-title":"BOFIT Discussion Papers"},{"issue":"3","key":"10.7717\/peerj-cs.3886\/ref-16","doi-asserted-by":"publisher","first-page":"273","DOI":"10.1016\/j.eswa.2019.03.029","article-title":"CNNpred: CNN-based stock market prediction using a diverse set of variables","volume":"129","author":"Hoseinzade","year":"2019","journal-title":"Expert Systems with Applications"},{"issue":"1","key":"10.7717\/peerj-cs.3886\/ref-17","doi-asserted-by":"publisher","first-page":"1776","DOI":"10.1016\/j.matpr.2021.10.460","article-title":"Stock price prediction methodology using random forest algorithm and support vector machine","volume":"56","author":"Illa","year":"2022","journal-title":"Materials Today: Proceedings"},{"key":"10.7717\/peerj-cs.3886\/ref-18","doi-asserted-by":"publisher","DOI":"10.2139\/ssrn.4843798","article-title":"A study on the corporate governance insights for personal financial planning","author":"Jun","year":"2024"},{"key":"10.7717\/peerj-cs.3886\/ref-19","doi-asserted-by":"publisher","DOI":"10.48550\/arXiv.1605.00003","article-title":"Predicting the direction of stock market prices using random forest","author":"Khaidem","year":"2016"},{"issue":"2","key":"10.7717\/peerj-cs.3886\/ref-20","doi-asserted-by":"publisher","first-page":"218","DOI":"10.26555\/ijain.v9i2.898","article-title":"Predicting extreme events in the stock market using generative adversarial networks","volume":"9","author":"Labiad","year":"2023","journal-title":"International Journal of Advances in Intelligent Informatics"},{"issue":"4","key":"10.7717\/peerj-cs.3886\/ref-21","doi-asserted-by":"publisher","first-page":"541","DOI":"10.1162\/neco.1989.1.4.541","article-title":"Backpropagation applied to handwritten zip code recognition","volume":"1","author":"LeCun","year":"1989","journal-title":"Neural Computation"},{"key":"10.7717\/peerj-cs.3886\/ref-22","doi-asserted-by":"publisher","first-page":"14","DOI":"10.1016\/j.neucom.2021.04.038","article-title":"On the diversity of multi-head attention","volume":"454","author":"Li","year":"2021","journal-title":"Neurocomputing"},{"issue":"1","key":"10.7717\/peerj-cs.3886\/ref-23","doi-asserted-by":"publisher","first-page":"373","DOI":"10.1007\/s00181-024-02644-6","article-title":"Enhancing stock price prediction using GANs and transformer-based attention mechanisms","volume":"68","author":"Li","year":"2025","journal-title":"Empirical Economics"},{"issue":"5","key":"10.7717\/peerj-cs.3886\/ref-24","doi-asserted-by":"publisher","first-page":"2413","DOI":"10.1109\/TCSII.2022.3160266","article-title":"Pearson correlation coefficient-based performance enhancement of broad learning system for stock price prediction","volume":"69","author":"Li","year":"2022","journal-title":"IEEE Transactions on Circuits and Systems II: Express Briefs"},{"issue":"3","key":"10.7717\/peerj-cs.3886\/ref-25","doi-asserted-by":"publisher","first-page":"188","DOI":"10.3844\/jcssp.2021.188.196","article-title":"Stock price prediction using generative adversarial networks","volume":"17","author":"Lin","year":"2021","journal-title":"Journal of Computer Science"},{"key":"10.7717\/peerj-cs.3886\/ref-26","doi-asserted-by":"publisher","DOI":"10.48550\/arXiv.1703.03130","article-title":"A structured self attentive sentence embedding","author":"Lin","year":"2017"},{"issue":"4","key":"10.7717\/peerj-cs.3886\/ref-27","doi-asserted-by":"publisher","first-page":"1705","DOI":"10.1111\/0022-1082.00265","article-title":"Foundations of technical analysis: computational algorithms, statistical inference, and empirical implementation","volume":"55","author":"Lo","year":"2000","journal-title":"The Journal of Finance"},{"key":"10.7717\/peerj-cs.3886\/ref-28","doi-asserted-by":"publisher","first-page":"141960\u2013141969","DOI":"10.1109\/ACCESS.2019.2942614","article-title":"Sentiment analysis of text based on bidirectional LSTM with multi-head attention","volume":"7","author":"Long","year":"2019","journal-title":"IEEE Access"},{"issue":"10","key":"10.7717\/peerj-cs.3886\/ref-29","doi-asserted-by":"publisher","first-page":"4741","DOI":"10.1007\/s00521-020-05532-z","article-title":"A CNN-BiLSTM-AM method for stock price prediction","volume":"33","author":"Lu","year":"2021","journal-title":"Neural Computing and Applications"},{"issue":"4\/609","key":"10.7717\/peerj-cs.3886\/ref-30","first-page":"19","article-title":"Limitation of ARIMA models in financial and monetary economics","volume":"23","author":"Petric\u0103","year":"2016","journal-title":"Theoretical & Applied Economics"},{"issue":"1","key":"10.7717\/peerj-cs.3886\/ref-31","doi-asserted-by":"publisher","first-page":"1","DOI":"10.1057\/s41599-024-02807-x","article-title":"Applying machine learning algorithms to predict the stock price trend in the stock market\u2014the case of Vietnam","volume":"11","author":"Phuoc","year":"2024","journal-title":"Humanities and Social Sciences Communications"},{"issue":"12","key":"10.7717\/peerj-cs.3886\/ref-32","doi-asserted-by":"publisher","first-page":"4739","DOI":"10.3390\/en16124739","article-title":"Peak electrical energy consumption prediction by ARIMA, LSTM, GRU, ARIMA-LSTM and ARIMA-GRU approaches","volume":"16","author":"Pierre","year":"2023","journal-title":"Energies"},{"issue":"12","key":"10.7717\/peerj-cs.3886\/ref-33","doi-asserted-by":"publisher","first-page":"e13700","DOI":"10.1111\/exsy.13700","article-title":"A new method based on generative adversarial networks for multivariate time series prediction","volume":"41","author":"Qin","year":"2024","journal-title":"Expert Systems"},{"issue":"13","key":"10.7717\/peerj-cs.3886\/ref-34","doi-asserted-by":"publisher","first-page":"8483","DOI":"10.1007\/s00500-021-05775-5","article-title":"Forecasting stock price using integrated artificial neural network and metaheuristic algorithms compared to time series models","volume":"25","author":"Shahvaroughi Farahani","year":"2021","journal-title":"Soft Computing"},{"key":"10.7717\/peerj-cs.3886\/ref-35","doi-asserted-by":"publisher","first-page":"75","DOI":"10.1007\/978-3-319-52452-8","article-title":"ARIMA models","volume-title":"Time Series Analysis and its Applications: With R Examples","author":"Shumway","year":"2017"},{"issue":"1","key":"10.7717\/peerj-cs.3886\/ref-36","doi-asserted-by":"publisher","first-page":"329","DOI":"10.47709\/cnahpc.v7i1.5474","article-title":"Combination of regression and ARIMA methods (Reg-ARIMA) stock price prediction model","volume":"7","author":"Sinulingga","year":"2025","journal-title":"Journal of Computer Networks, Architecture and High Performance Computing"},{"key":"10.7717\/peerj-cs.3886\/ref-37","doi-asserted-by":"publisher","first-page":"83786","DOI":"10.1109\/ACCESS.2021.3086537","article-title":"Forecasting stock market indices using padding-based Fourier transform denoising and time series deep learning models","volume":"9","author":"Song","year":"2021","journal-title":"IEEE Access"},{"key":"10.7717\/peerj-cs.3886\/ref-38","doi-asserted-by":"publisher","DOI":"10.48550\/arXiv.2107.09055","article-title":"Stock price prediction using BERT and GAN","author":"Sonkiya","year":"2021"},{"issue":"05","key":"10.7717\/peerj-cs.3886\/ref-39","doi-asserted-by":"publisher","first-page":"8976","DOI":"10.1609\/aaai.v34i05.6429","article-title":"Generating diverse translation by manipulating multi-head attention","volume":"34","author":"Sun","year":"2020","journal-title":"Proceedings of the AAAI Conference on Artificial Intelligence"},{"issue":"5","key":"10.7717\/peerj-cs.3886\/ref-40","first-page":"44","article-title":"A study on fundamental and technical analysis","volume":"2","author":"Suresh","year":"2013","journal-title":"International Journal of Marketing, Financial Services & Management Research"},{"issue":"5","key":"10.7717\/peerj-cs.3886\/ref-41","doi-asserted-by":"publisher","first-page":"1199","DOI":"10.1002\/for.3071","article-title":"Stock movement prediction: a multi-input LSTM approach","volume":"43","author":"Tang","year":"2024","journal-title":"Journal of Forecasting"},{"issue":"4\u20135","key":"10.7717\/peerj-cs.3886\/ref-42","doi-asserted-by":"publisher","first-page":"257","DOI":"10.1007\/BF00332914","article-title":"Accelerating the convergence of the back-propagation method","volume":"59","author":"Vogl","year":"1988","journal-title":"Biological Cybernetics"},{"issue":"3","key":"10.7717\/peerj-cs.3886\/ref-43","doi-asserted-by":"publisher","first-page":"3381","DOI":"10.11591\/ijai.v13.i3.pp3381-3394","article-title":"An improved convolutional recurrent neural network for stock price forecasting","volume":"13","author":"Vuong","year":"2024","journal-title":"IAES International Journal of Artificial Intelligence (IJ-AI)"},{"issue":"2","key":"10.7717\/peerj-cs.3886\/ref-44","doi-asserted-by":"publisher","first-page":"199","DOI":"10.3390\/biomimetics8020199","article-title":"Distract your attention: multi-head cross attention network for facial expression recognition","volume":"8","author":"Wen","year":"2023","journal-title":"Biomimetics"},{"issue":"01","key":"10.7717\/peerj-cs.3886\/ref-45","doi-asserted-by":"publisher","first-page":"387","DOI":"10.1609\/aaai.v33i01.3301387","article-title":"Context-aware self-attention networks","volume":"33","author":"Yang","year":"2019","journal-title":"Proceedings of the AAAI Conference on Artificial Intelligence"},{"issue":"23","key":"10.7717\/peerj-cs.3886\/ref-46","doi-asserted-by":"publisher","first-page":"3738","DOI":"10.3390\/math12233738","article-title":"CNN-CBAM-LSTM: enhancing stock return prediction through long and short information mining in stock prediction","volume":"12","author":"Ye","year":"2024","journal-title":"Mathematics"},{"issue":"1","key":"10.7717\/peerj-cs.3886\/ref-47","doi-asserted-by":"publisher","first-page":"1","DOI":"10.3745\/JIPS.04.0023","article-title":"A comprehensive review of emerging computational methods for gene identification","volume":"12","author":"Yu","year":"2016","journal-title":"Journal of Information Processing Systems"},{"issue":"3","key":"10.7717\/peerj-cs.3886\/ref-48","doi-asserted-by":"publisher","first-page":"3015","DOI":"10.1051\/itmconf\/20257003015","article-title":"LSTM-based time series prediction model: a case study with yFinance stock data","volume":"70","author":"Yu","year":"2025","journal-title":"ITM Web of Conferences"},{"issue":"1","key":"10.7717\/peerj-cs.3886\/ref-49","doi-asserted-by":"publisher","first-page":"302","DOI":"10.54254\/2754-1169\/65\/20231677","article-title":"An empirical study of Shanghai composite index forecasts and trend trading strategies based on ARIMA model","volume":"65","author":"Zhang","year":"2023","journal-title":"Advances in Economics, Management and Political Science"},{"issue":"5","key":"10.7717\/peerj-cs.3886\/ref-50","doi-asserted-by":"publisher","first-page":"77368","DOI":"10.1109\/ACCESS.2024.3406223","article-title":"Integration of emotional factors with GAN algorithm in stock price prediction method research","volume":"12","author":"Zhang","year":"2024","journal-title":"IEEE Access"}],"container-title":["PeerJ Computer Science"],"original-title":[],"language":"en","link":[{"URL":"https:\/\/peerj.com\/articles\/cs-3886.pdf","content-type":"application\/pdf","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/peerj.com\/articles\/cs-3886.xml","content-type":"application\/xml","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/peerj.com\/articles\/cs-3886.html","content-type":"text\/html","content-version":"vor","intended-application":"text-mining"},{"URL":"https:\/\/peerj.com\/articles\/cs-3886.pdf","content-type":"unspecified","content-version":"vor","intended-application":"similarity-checking"}],"deposited":{"date-parts":[[2026,5,21]],"date-time":"2026-05-21T08:51:53Z","timestamp":1779353513000},"score":1,"resource":{"primary":{"URL":"https:\/\/peerj.com\/articles\/cs-3886"}},"subtitle":[],"short-title":[],"issued":{"date-parts":[[2026,5,21]]},"references-count":50,"alternative-id":["10.7717\/peerj-cs.3886"],"URL":"https:\/\/doi.org\/10.7717\/peerj-cs.3886","archive":["CLOCKSS","LOCKSS","Portico"],"relation":{},"ISSN":["2376-5992"],"issn-type":[{"value":"2376-5992","type":"electronic"}],"subject":[],"published":{"date-parts":[[2026,5,21]]},"article-number":"e3886"}}