Skip to main content

Advertisement

Log in

StockAICloud: AI-based sustainable and scalable stock price prediction framework using serverless cloud computing

  • Published:
The Journal of Supercomputing Aims and scope Submit manuscript

Abstract

The inherent volatility of the stock market presents significant challenges for accurate price forecasting, influenced by factors such as market sentiment, economic indicators, and geopolitical events. In this paper, we propose an Artificial Intelligence (AI)-based stock price prediction framework, StockAICloud, built with FastAPI to offer scalable and sustainable services via serverless cloud computing. The StockAICloud framework focuses on HDFC Bank’s stock and forecasts both open and close prices for future dates, using historical data obtained from Yahoo Finance. StockAICloud employs three deep learning models, including long short-term memory (LSTM), gated recurrent units (GRU), and convolutional neural networks (CNN), with experimental results showing that the LSTM model achieved the highest performance (\(R^2\) = 0.9106), making it the preferred choice for deployment. Further, StockAICloud was deployed on both server-based and serverless cloud environments. The serverless deployment on amazon web services (AWS) Fargate demonstrated superior scalability under high concurrency, achieving a maximum throughput of 21.2 requests per minute with 400 concurrent requests. These findings underscore the potential of integrating deep learning models with scalable serverless cloud services to deliver sustainable and real-time stock price predictions.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Subscribe and save

Springer+ Basic
$34.99 /Month
  • Get 10 units per month
  • Download Article/Chapter or eBook
  • 1 Unit = 1 Article or 1 Chapter
  • Cancel anytime
Subscribe now

Buy Now

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Algorithm 1
Algorithm 2
Fig. 4
Fig. 5
Fig. 6
Fig. 7

Similar content being viewed by others

Explore related subjects

Discover the latest articles and news from researchers in related subjects, suggested using machine learning.

Data availability

We made available this work for free as open source. All code and result reproducibility scripts are publicly available and can be accessed from GitHub: https://github.com/HTXW/StockAICloud

References

  1. Pardeshi K, Gill SS, Abdelmoniem AM (2024) Stock market price prediction. In: Applications of AI for Interdisciplinary Research, pp. 122–140. CRC Press, Boca Raton. https://doi.org/10.1201/9781003467199

  2. Wang J, Zhou M, Guo X, Wang X, Al-Turki Y (2024) Dynamic dependence and hedging of stock markets: evidence from time-varying copula with asymmetric Markovian models. IEEE Trans Comput Soc Syst. https://doi.org/10.1109/TCSS.2023.3346439

    Article  MATH  Google Scholar 

  3. Eichengreen B (2024) International finance and geopolitics. Asian Econ Policy Rev 19(1):84–100. https://doi.org/10.1111/aepr.12436

    Article  MATH  Google Scholar 

  4. KPMG: 2023 U.S. Banking and Financial Services Industry Review and 2024 Outlook. https://lambert.com/2023-u-s-banking-and-financial-services-industry-review-and-2024-outlook/. [Accessed 22-08-2024]

  5. KPMG: 2024 Banking trends. https://kpmg.com/us/en/articles/2024/banking-trends.html. [Accessed 22-08-2024]

  6. Henrique BM, Sobreiro VA, Kimura H (2019) Literature review: machine learning techniques applied to financial market prediction. Exp Syst Appl 124:226–251

    Article  Google Scholar 

  7. Thakkar A, Chaudhari K (2021) A comprehensive survey on deep neural networks for stock market: the need, challenges, and future directions. Exp Syst Appl 177:114800

    Article  MATH  Google Scholar 

  8. Nti IK, Adekoya AF, Weyori BA (2020) A systematic review of fundamental and technical analysis of stock market predictions. Artif Intell Rev 53(4):3007–3057. https://doi.org/10.1007/s10462-019-09754-z

    Article  MATH  Google Scholar 

  9. Gill SS, Xu M, Ottaviani C, Patros P, Bahsoon R, Shaghaghi A, Golec M, Stankovski V, Wu H, Abraham A et al (2022) Ai for next generation computing: emerging trends and future directions. Internet of Things 19:100514

    Article  Google Scholar 

  10. Yahoo: Yahoo Finance. https://finance.yahoo.com/quote/HDFCBANK.NS/. [Accessed 22-08-2024]

  11. Amazon: Serverless on AWS. https://aws.amazon.com/serverless/. [Accessed 22-08-2024]

  12. Shafiei Hossein, Khonsari Ahmad, Mousavi Payam (2022) Serverless computing: a survey of opportunities, challenges, and applications. ACM Comput Surv 54(11s):1–32. https://doi.org/10.1145/3510611

    Article  MATH  Google Scholar 

  13. Hassan HB, Barakat SA, Sarhan QI (2021) Survey on serverless computing. J Cloud Comput 10(1):39. https://doi.org/10.1186/s13677-021-00253-7

    Article  MATH  Google Scholar 

  14. Gandhmal DP, Kumar K (2019) Systematic analysis and review of stock market prediction techniques. Comput Sci Rev 34:100190

    Article  MathSciNet  Google Scholar 

  15. Du Kelvin, Xing Frank, Mao Rui, Cambria Erik (2024) Financial sentiment analysis: techniques and applications. ACM Comput Surv 56(9):1–42. https://doi.org/10.1145/3649451

    Article  MATH  Google Scholar 

  16. Sezer OB, Gudelek MU, Ozbayoglu AM (2020) Financial time series forecasting with deep learning: a systematic literature review: 2005–2019. Appl Soft Comput 90:106181. https://doi.org/10.1016/j.asoc.2020.106181

    Article  MATH  Google Scholar 

  17. Jiang W (2021) Applications of deep learning in stock market prediction: recent progress. Exp Syst Appl 184:115537

    Article  Google Scholar 

  18. Bustos O, Pomares-Quimbaya A (2020) Stock market movement forecast: a systematic review. Exp Syst Appl 156:113464. https://doi.org/10.1016/j.eswa.2020.113464

    Article  MATH  Google Scholar 

  19. Golec M, Gill SS, Parlikad AK, Uhlig S (2023) Healthfaas: Ai-based smart healthcare system for heart patients using serverless computing. IEEE Internet Things J 10(21):18469–18476. https://doi.org/10.1109/JIOT.2023.3277500

    Article  Google Scholar 

  20. Immaneni J (2020) Cloud migration for fintech: how kubernetes enables multi-cloud success. Innovative Computer Sciences Journal 6(1)

  21. Sakthidevi I, Rajkumar GV, Sunitha R, Sangeetha A, Krishnan RS, Sundararajan S Machine learning orchestration in cloud environments: Automating the training and deployment of distributed machine learning ai model. In: 2023 7th International Conference on I-SMAC (IoT in Social, Mobile, Analytics and Cloud) (I-SMAC), pp. 376–384 (2023). https://doi.org/10.1109/I-SMAC58438.2023.10290278

  22. García ÁL, De Lucas JM, Antonacci M, Zu Castell W, David M, Hardt M, Iglesias LL, Moltó G, Plociennik M, Tran V et al (2020) A cloud-based framework for machine learning workloads and applications. IEEE access 8:18681–18692. https://doi.org/10.1109/ACCESS.2020.2964386

    Article  Google Scholar 

  23. Li Y, Lin Y, Wang Y, Ye K, Xu C (2022) Serverless computing: state-of-the-art, challenges and opportunities. IEEE Trans Serv Comput 16(2):1522–1539. https://doi.org/10.1109/TSC.2022.3166553

    Article  MATH  Google Scholar 

  24. Rath S, Das NR, Pattanayak BK (2024) Sstacked BI-LSTM and E-optimized CNN-a hybrid deep learning model for stock price prediction. Opt Memory Neural Netw 33(2):102–120. https://doi.org/10.3103/S1060992X24700024

    Article  MATH  Google Scholar 

  25. Muhammad T, Aftab AB, Ibrahim M, Ahsan MM, Muhu MM, Khan SI, Alam MS (2023) Transformer-based deep learning model for stock price prediction: a case study on Bangladesh stock market. Int J Comput Intell Appl 22(03):2350013. https://doi.org/10.1142/S146902682350013X

    Article  MATH  Google Scholar 

  26. Bhandari HN, Rimal B, Pokhrel NR, Rimal R, Dahal KR, Khatri RK (2022) Predicting stock market index using lstm. Mach Learn Appl 9:100320. https://doi.org/10.1016/j.mlwa.2022.100320

    Article  Google Scholar 

  27. Zhang X, Qu S, Huang J, Fang B, Yu P (2018) Stock market prediction via multi-source multiple instance learning. IEEE Access 6:50720–50728. https://doi.org/10.1109/ACCESS.2018.2869735

    Article  MATH  Google Scholar 

  28. Bustos O, Pomares-Quimbaya A (2020) Stock market movement forecast: a systematic review. Exp Syst Appl 156:113464. https://doi.org/10.1016/j.eswa.2020.113464

    Article  MATH  Google Scholar 

  29. A, A., R, R., S, V.R., Bagde, A.M.: Predicting Stock Market Time-Series Data using CNN-LSTM Neural Network Model. arXiv (2023). https://doi.org/10.48550/ARXIV.2305.14378

  30. Li M, Chen H, Yan B, Xu Q, Chen Q Research on stock volatility prediction using attention mechanism enhanced gru ensemble model. In: Proceedings of the 2024 International Conference on Generative Artificial Intelligence and Information Security. GAIIS ’24, pp. 54–58. Association for Computing Machinery, New York, NY, USA (2024). https://doi.org/10.1145/3665348.3665359

  31. Gao Y, Wang R, Zhou E (2021) Stock prediction based on optimized lstm and gru models. Sci Program 2021(1):4055281. https://doi.org/10.1155/2021/4055281

    Article  MATH  Google Scholar 

  32. Fischer T, Krauss C (2018) Deep learning with long short-term memory networks for financial market predictions. Eur J Oper Res 270(2):654–669. https://doi.org/10.1016/j.ejor.2017.11.054

    Article  MathSciNet  MATH  Google Scholar 

  33. Chen Q, Zhang W, Lou Y (2020) Forecasting stock prices using a hybrid deep learning model integrating attention mechanism, multi-layer perceptron, and bidirectional long-short term memory neural network. IEEE Access 8:117365–117376. https://doi.org/10.1109/ACCESS.2020.3004284

    Article  Google Scholar 

  34. Istiake Sunny MA, Maswood MMS, Alharbi AG Deep learning-based stock price prediction using lstm and bi-directional lstm model. In: 2020 2nd Novel Intelligent and Leading Emerging Sciences Conference (NILES), pp. 87–92 (2020). https://doi.org/10.1109/NILES50944.2020.9257950

  35. Haq AU, Zeb A, Lei Z, Zhang D (2021) Forecasting daily stock trend using multi-filter feature selection and deep learning. Exp Syst Appl 168:114444. https://doi.org/10.1016/j.eswa.2020.114444

    Article  Google Scholar 

  36. Patel J, Shah S, Thakkar P, Kotecha K (2015) Predicting stock and stock price index movement using trend deterministic data preparation and machine learning techniques. Expert Syst Appl 42(1):259–268. https://doi.org/10.1016/j.eswa.2014.07.040

    Article  MATH  Google Scholar 

  37. Investopedia — investopedia.com. https://www.investopedia.com/. [Accessed 22-08-2024]

  38. Chong E, Han C, Park FC (2017) Deep learning networks for stock market analysis and prediction: methodology, data representations, and case studies. Exp Syst Appl 83:187–205. https://doi.org/10.1016/j.eswa.2017.04.030

    Article  MATH  Google Scholar 

  39. Kumbure MM, Lohrmann C, Luukka P, Porras J (2022) Machine learning techniques and data for stock market forecasting: a literature review. Exp Syst Appl 197:116659. https://doi.org/10.1016/j.eswa.2022.116659

    Article  MATH  Google Scholar 

  40. Yu Y, Si X, Hu C, Zhang J (2019) A review of recurrent neural networks: LSTM cells and network architectures. Neural Comput 31(7):1235–1270. https://doi.org/10.1162/neco_a_01199

    Article  MathSciNet  MATH  Google Scholar 

  41. Van Houdt G, Mosquera C, Nápoles G (2020) A review on the long short-term memory model. Artif Intell Rev 53(8):5929–5955. https://doi.org/10.1007/s10462-020-09838-1

    Article  MATH  Google Scholar 

  42. Weerakody PB, Wong KW, Wang G, Ela W (2021) A review of irregular time series data handling with gated recurrent neural networks. Neurocomputing 441:161–178. https://doi.org/10.1016/j.neucom.2021.02.046

    Article  MATH  Google Scholar 

  43. Qi C, Ren J, Su J (2023) Gru neural network based on Ceemdan–Wavelet for stock price prediction. Appl Sci 13(12):7104. https://doi.org/10.3390/app13127104

    Article  MATH  Google Scholar 

  44. Kiranyaz S, Avci O, Abdeljaber O, Ince T, Gabbouj M, Inman DJ (2021) 1D convolutional neural networks and applications: a survey. Mech Syst Signal Process 151:107398. https://doi.org/10.1016/j.ymssp.2020.107398

    Article  MATH  Google Scholar 

  45. Zhang J, Ye L, Lai Y (2023) Stock price prediction using cnn-bilstm-attention model. Mathematics 11(9):1985. https://doi.org/10.3390/math11091985

    Article  MATH  Google Scholar 

  46. Alizadeh M, Fernández-Marqués J, Lane ND, Gal Y (2019) A systematic study of binary neural networks’ optimisation. In: International Conference on Learning Representations. https://openreview.net/forum?id=rJfUCoR5KX

  47. Chopra P, Chhapola A, Kaushik DS Comparative analysis of optimizing aws inferentia with fastapi and pytorch models. International Journal of Creative Research Thoughts (IJCRT) 10(2), 449–463

  48. Ramírez S FastAPI. https://fastapi.tiangolo.com/. [Accessed 22-08-2024]

  49. Kithulwatta WMCJT, Wickramaarachchi WU, Jayasena KPN, Kumara BTGS, Rathnayaka RMKT (2022) Adoption of Docker containers as an infrastructure for deploying software applications: A Review. In: Saeed, F., Al-Hadhrami, T., Mohammed, E., Al-Sarem, M. (eds.) Advances on Smart and Soft Computing, pp. 247–259. Springer, Singapore

  50. Amazon: What is an Application Load Balancer? https://docs.aws.amazon.com/elasticloadbalancing/latest/application/introduction.html. [Accessed 22-08-2024]

  51. Nuaimi KA, Mohamed N, Nuaimi MA, Al-Jaroodi J A survey of load balancing in cloud computing: Challenges and algorithms. In: 2012 Second Symposium on Network Cloud Computing and Applications, pp. 137–142 (2012). https://doi.org/10.1109/NCCA.2012.29

  52. Openja M, Majidi F, Khomh F, Chembakottu B, Li H Studying the practices of deploying machine learning projects on docker. In: Proceedings of the 26th International Conference on Evaluation and Assessment in Software Engineering. EASE ’22, pp. 190–200. Association for Computing Machinery, New York, NY, USA (2022). https://doi.org/10.1145/3530019.3530039

  53. Hodson TO (2022) Root-mean-square error (RMSE) or mean absolute error (MAE): when to use them or not. Geosci Model Dev 15(14):5481–5487. https://doi.org/10.5194/gmd-15-5481-2022

    Article  MATH  Google Scholar 

  54. Cort J, Kenji Matsuura W (2005) Advantages of the mean absolute error (MAE) over the root mean square error (RMSE) in assessing average model performance. Climate Res 30(1):79–82. https://doi.org/10.3354/cr030079

    Article  Google Scholar 

  55. Nakagawa S, Schielzeth H (2013) A general and simple method for obtaining r2 from generalized linear mixed-effects models. Methods Ecol Evol 4(2):133–142. https://doi.org/10.1111/j.2041-210x.2012.00261.x

    Article  MATH  Google Scholar 

  56. Ardagna D, Casale G, Ciavotta M, Pérez JF, Wang W (2014) Quality-of-service in cloud computing: modeling techniques and their applications. J Internet Serv Appl 5(1):11. https://doi.org/10.1186/s13174-014-0011-3

    Article  Google Scholar 

  57. Bardsiri AK, Hashemi SM (2014) QoS metrics for cloud computing services evaluation. Int J Intell Syst Appl 6(12):27–33. https://doi.org/10.5815/ijisa.2014.12.04

    Article  MATH  Google Scholar 

  58. Hayyolalam V, Pourhaji Kazem AA (2018) A systematic literature review on QoS-aware service composition and selection in cloud environment. J Netw Comput Appl 110:52–74. https://doi.org/10.1016/j.jnca.2018.03.003

    Article  Google Scholar 

  59. Balestrieri E, Picariello F, Rapuano S, Tudosa I (2019) Review on jitter terminology and definitions. Measurement 145:264–273. https://doi.org/10.1016/j.measurement.2019.05.047

    Article  MATH  Google Scholar 

  60. Sharma VK, Tripathi JN, Nagpal R, Deb S, Malik R (2014) A comparative analysis of jitter estimation techniques. In: 2014 International Conference on Electronics, Communication and Computational Engineering (ICECCE), pp. 125–130. https://doi.org/10.1109/ICECCE.2014.7086645

  61. McDonald J, Li B, Frey N, Tiwari D, Gadepally V, Samsi S (2022) Great power, great responsibility: recommendations for reducing energy for training language models https://doi.org/10.18653/v1/2022.findings-naacl.151

  62. Patterson D, Gonzalez J, Le Q, Liang C, Munguia L-M, Rothchild D, So D, Texier M, Dean J (2021) Carbon emissions and large neural network training

  63. Shaji George A, Hovan George A, Martin A (2023) The environmental impact of AI: a case study of water consumption by chat GPT. Partner Univ Int Innov J 2(1):97–104. https://doi.org/10.5281/zenodo.7855594

    Article  MATH  Google Scholar 

  64. Zhou Q, Xu M, Gill SS, Gao C, Tian W, Xu C, Buyya R (2020) Energy efficient algorithms based on vm consolidation for cloud computing: comparisons and evaluations. In: 2020 20th IEEE/ACM International Symposium on Cluster, Cloud and Internet Computing (CCGRID), pp. 489–498. IEEE

  65. Povoa LV, Marcondes C, Senger H (2017) Modelling energy consumption based on resource utilization. arXiv. Version Number: 1. https://doi.org/10.48550/ARXIV.1709.06076

  66. Ghorbian M, Ghobaei-Arani M (2024) A survey on the cold start latency approaches in serverless computing: an optimization-based perspective. Computing 106(11):3755–3809. https://doi.org/10.1007/s00607-024-01335-5

    Article  MATH  Google Scholar 

  67. Shojaee rad Z, Ghobaei-Arani M, Ahsan R (2024) Memory orchestration mechanisms in serverless computing: a taxonomy, review and future directions. Cluster Comput 27(5):5489–5515. https://doi.org/10.1007/s10586-023-04251-z

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Contributions

Han Wang contributed to conceptualization, data curation, formal analysis, investigation, methodology, software, validation, writing—original draft, writing—review and editing. Vidhyaa Shree Rajakumar contributed to conceptualization, data curation, formal analysis, investigation, methodology, software, validation, writing—original draft. Muhammed Golec validation, writing—review and editing. Sukhpal Singh Gill helped in supervision, writing—original draft, writing—review and editing. Steve Uhlig supervision, writing—original draft, writing—review and editing

Corresponding author

Correspondence to Sukhpal Singh Gill.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Springer Nature or its licensor (e.g. a society or other partner) holds exclusive rights to this article under a publishing agreement with the author(s) or other rightsholder(s); author self-archiving of the accepted manuscript version of this article is solely governed by the terms of such publishing agreement and applicable law.

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Wang, H., Rajakumar, V.S., Golec, M. et al. StockAICloud: AI-based sustainable and scalable stock price prediction framework using serverless cloud computing. J Supercomput 81, 527 (2025). https://doi.org/10.1007/s11227-025-06984-7

Download citation

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11227-025-06984-7

Keywords