A Framework for Automated Hyperparameter Optimization of LSTM Networks Using Marine Predators Algorithm for Stock Price Prediction

Document Type : Original Article

Authors
1 Shahrekord University,Department of Computer Engineering, Faculty of Engineering,Shahrekord,Iran
2 a Department of Computer Engineering, Shahrekord University, Shahrekord, Iran
10.22034/aise.2026.15257.1012
Abstract
Accurate stock price prediction remains a fundamental challenge in financial analytics due to market non-linearity, high volatility, and the inherent noise present in financial time series. While Long Short-Term Memory (LSTM) networks have demonstrated remarkable capability in capturing long-term temporal dependencies, their predictive performance critically depends on the precise configuration of hyperparameters. This study proposes an automated optimization framework that integrates the Marine Predators Algorithm (MPA) with LSTM networks to jointly optimize key hyperparameters—including the number of hidden units, learning rate, and batch size. MPA, a nature-inspired metaheuristic, effectively balances exploration and exploitation through a three-phase structure combining Brownian and Lévy movement strategies. We evaluated the proposed MPA-LSTM framework on daily stock data from 20 major tickers spanning 2019–2024, obtained from Yahoo Finance. Benchmarking against Genetic Algorithm (GA), Particle Swarm Optimization (PSO), and Harris Hawks Optimization (HHO) revealed that MPA achieved superior predictive accuracy in 75% of the primary technology tickers, with the best performance recorded on AAPL (Test RMSE = 0.01561, R² = 0.9431). Sensitivity analysis identified a population size of 10 with 10 iterations as the optimal trade-off between precision and computational cost (85.13 seconds). Across all 20 tickers, the model maintained robust generalization with an average Test RMSE of approximately 0.032 and average R² of 0.903; 90% of tickers exceeded an R² of 0.80. A hybrid CNN-LSTM extension further reduced prediction error by 7%. Finally, the Wilcoxon signed-rank test confirmed the statistical significance of MPA's superiority over PSO at the 95% confidence level (p = 0.0391).
Keywords
Subjects


Articles in Press, Accepted Manuscript
Available Online from 19 September 2026