<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>An intelligent system for forecasting time series based on a neural network with LSTM-blocks</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Vasyl Lytvyn</string-name>
          <email>vasyl.v.lytvyn@lpnu.ua</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ivan Peleshchak</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Yurii Futryk</string-name>
          <email>yurii.v.futryk@lpnu.ua</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Roman Peleshchak</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andriy</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Khudyy</string-name>
          <email>khudyy@ukr.net</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Andriy Senyk</string-name>
          <email>andrij.p.senyk@lpnu.ua</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Lviv Polytechnic National University</institution>
          ,
          <addr-line>Stepana Bandery Street, 12, 79000, Lviv</addr-line>
          ,
          <country country="UA">Ukraine</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Improving time series forecasting methods is a critical task for various industries, including finance, manufacturing, military applications, medicine, mine clearance processes, including time-based analysis of GPR and magnetometer data, and energy in the era of Industry 4.0. The use of recurrent neural networks with LSTM units is an effective approach for predicting long-term dependencies in data. However, the optimal configuration of the long short-term memory (LSTM) architecture remains an open question, in particular, the choice of the number of blocks, the dropout rate, and the use of technical indicators to improve prediction accuracy. This study presents a detailed analysis of the impact of key hyperparameters in LSTM models, including the number of blocks (100-400), the dropout rate (0.1-0.3), and the role of technical indicators such as EMA (Exponential Moving Average) and RSI (Relative Strength Index) in generating accurate forecasts. The obtained results show that EMA_20 has the highest correlation coefficient (0.99) with the closing price, while RSI demonstrates a weaker relationship (0.04-0.05), which emphasizes its secondary role. The training algorithm for the neural network with LSTM blocks was optimized using the Nadam optimizer, which allowed us to determine the most effective combination of hyperparameters for forecasting financial time series. The training data was obtained from the Yahoo Finance (yfinance) library and included historical data on the Google (GOOGL) stock price for the period from 2011 to 2024. The model performance was evaluated using the MSE, RMSE and MAPE metrics, which allowed us to objectively assess the level of forecasting accuracy. The analysis of the obtained results showed that the optimal configuration of the neural network consists of 350 LSTM units, a Dropout level of 0.05, and the Nadam optimizer. This configuration achieved a minimum average absolute percentage error (MAPE) of 1.64%, which is lower than the results obtained in previous studies. The study confirms that increasing the number of LSTM blocks beyond 350 does not improve accuracy and may lead to overfitting.</p>
      </abstract>
      <kwd-group>
        <kwd>eol&gt;LSTM recurrent neural network</kwd>
        <kwd>time series forecasting</kwd>
        <kwd>MAPE</kwd>
        <kwd>Dropout</kwd>
        <kwd>Nadam optimizer</kwd>
        <kwd>technical indicators</kwd>
        <kwd>EMA</kwd>
        <kwd>RSI</kwd>
        <kwd>1</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>Time series forecasting is a key task in the era of Industry 4.0, encompassing finance, marketing,
energy, medicine, and landmine clearance processes, including time-series analysis of
groundpenetrating radar and magnetometer data. One of the most effective tools in this domain is the Long
Short-Term Memory (LSTM) recurrent neural network, which has the ability to retain long-term
temporal dependencies between data points.</p>
      <p>In the context of Intelligent Systems and Technologies in Industry, LSTM models are actively
utilized for early failure detection in industrial equipment, forecasting production line loads,
identifying anomalous patterns in sensor data, and enhancing the efficiency of logistics management.
Conversely, in humanitarian and military fields, LSTM models are applied to mine clearance
operations, including time-series analysis of ground-penetrating radar and magnetometer data,
forecasting potential landmine displacement due to weather and geological factors, and optimizing
0000-0002-9676-0180 (V. Lytvyn); 0000-0002-7481-8628 (I. Peleshchak); 0000-0001-5271-9883 (Y. Futryk);
0000-00020536-3252 (R. Peleshchak); 0000-0003-2029-7270 (A. Khudyy); 0000-0002-1614-512X (A. Senyk)
resource allocation in demining missions. Due to LSTM's ability to retain long-term temporal
contexts, these tasks can be solved with greater accuracy and efficiency.</p>
    </sec>
    <sec id="sec-2">
      <title>2. Review and analysis of recent studies</title>
      <p>
        Recurrent neural networks (RNNs) incorporating Long Short-Term Memory (LSTM) units are
extensively employed for time series prediction in modern computational research [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]. Despite
significant progress in this field, multiple unresolved challenges persist. The application of
LSTMbased models for forecasting sequential data remains a pivotal area in contemporary neural
engineering [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. While various architectural modifications of LSTM networks yield promising
outcomes, certain aspects of model optimization still require refinement.
      </p>
      <p>
        The study in [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] explores a methodology where stacked autoencoders are combined with LSTM
layers to improve financial time series predictions. The authors report a forecasting precision of
MAPE ≈ 2.2%. However, the model demonstrates constrained adaptability to fluctuations in market
conditions due to the absence of technical indicators during the training phase.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ], an LSTM model is enhanced with an attention mechanism, enabling the neural network to
prioritize significant temporal markers. While this modification improves forecast accuracy (MAPE ≈
2.0%), the model lacks optimization in terms of computational efficiency and does not account for the
impact of Dropout regularization on training stability.
      </p>
      <p>
        The work presented in [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] examines the integration of technical indicators such as the
Exponential Moving Average (EMA) and the Relative Strength Index (RSI) into LSTM-based stock
price forecasting models. Despite achieving a forecasting accuracy of MAPE ≈ 1.95%, the model does
not incorporate adaptive optimization algorithms, particularly Nadam, which could improve
performance in volatile financial markets.
      </p>
      <p>
        A comparative evaluation of LSTM and Gated Recurrent Unit (GRU) models is conducted in [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ],
where the authors establish that LSTM-based architectures are more effective for financial
predictions, reaching MAPE ≈ 1.9%. However, this study does not explore the influence of varying
LSTM block counts or Dropout levels on model robustness.
      </p>
      <p>
        In [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ], researchers assess the effectiveness of low-value Dropout regularization in improving
LSTM model stability. Although the study reports a forecasting precision of MAPE ≈ 1.9%, it does not
consider the impact of LSTM block count variation and adaptive loss functions on overall prediction
reliability.
      </p>
      <p>
        Findings from studies [
        <xref ref-type="bibr" rid="ref10 ref9">9, 10</xref>
        ] suggest that machine learning methodologies are progressively
supplanting traditional forecasting models, particularly in cases involving extensive datasets with
complex interdependencies. Ensemble learning techniques such as Random Forest and XGBoost,
alongside regression-based models incorporating supplementary features (e.g., lagging indicators,
seasonality, and market anomalies), have demonstrated enhanced predictive accuracy. However, the
challenge of selecting optimal hyperparameters and ensuring model interpretability remains.
      </p>
      <p>
        Several studies [
        <xref ref-type="bibr" rid="ref11 ref12">11, 12</xref>
        ] investigate hybrid modeling strategies that integrate statistical and neural
network approaches (e.g., ARIMA+LSTM, SARIMA+MLP). These models leverage the explainability
of statistical trend analysis while capitalizing on the adaptability of deep learning methods. However,
the complexity of hybrid pipelines increases computational costs and necessitates extensive data
preprocessing.
      </p>
      <p>
        Research efforts detailed in [
        <xref ref-type="bibr" rid="ref13 ref14">13, 14</xref>
        ] focus on time series prediction, particularly the forecasting of
Yahoo Finance stock price data using LSTM networks trained with Adam [
        <xref ref-type="bibr" rid="ref13">13</xref>
        ] and Nadam [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ]
optimization algorithms. The reported prediction accuracy, measured by MAPE, reached 1.9%.
      </p>
      <p>It is noteworthy that Adam, as referenced in multiple studies, utilizes a conventional adaptive
weight adjustment approach based on the mean squared gradients and their exponentially smoothed
moments. However, Adam does not account for a "lookahead" gradient component. In contrast, the
Nadam optimizer incorporates a projected gradient update mechanism, adjusting weights based on
anticipated rather than current gradient values. This methodological distinction enables Nadam to
enhance the accuracy of LSTM-based time series forecasting. The primary factors influencing
forecasting performance include the number of LSTM units, the level of Dropout regularization, and
the incorporation of additional technical indicators such as EMA and RSI.</p>
    </sec>
    <sec id="sec-3">
      <title>3. The purpose and objectives of the research</title>
      <p>
        A review of existing literature [
        <xref ref-type="bibr" rid="ref1 ref10 ref11 ref12 ref13 ref14 ref2 ref3 ref4 ref5 ref6 ref7 ref8 ref9">1–14</xref>
        ] reveals that LSTM model accuracy is typically constrained by a
Mean Absolute Percentage Error (MAPE) exceeding 1.9%, indicating the need for further
advancements in both network architecture and training methodologies. Several key challenges
persist in time series forecasting using LSTM-based neural networks:



      </p>
      <p>Development of an optimal model architecture and training algorithm with different
LSTMblock configurations (100, 200, 300, 400) and trained with the Nadam optimizer. The study
aims to identify the most effective Dropout regularization value (0.1, 0.2, 0.3) to prevent
overfitting while balancing generalization and accuracy.</p>
      <p>Impact of technical indicators such as the Exponential Moving Average (EMA_20) and the
Relative Strength Index (RSI) on forecasting accuracy, as these indicators help smooth
stochastic fluctuations in data;</p>
      <p>Evaluation of model accuracy using metrics such as MSE, RMSE and MAPE.</p>
      <p>Thus, the critical issue is designing an optimal LSTM architecture configuration and training
algorithm using the Nadam optimizer, selecting the appropriate number of blocks, tuning the
Dropout level, and incorporating technical indicators to enhance time series forecasting accuracy.</p>
      <p>To achieve this objective, the study focuses on solving the following tasks:




</p>
      <p>Determining the optimal number of LSTM-blocks in a sequential network to achieve a
forecasting error below 1.8%;
Optimizing the training process of the LSTM neural network using the Nadam optimizer;
Investigating the role of Dropout regularization in improving the predictive performance of
LSTM models;
Analyzing the impact of EMA and RSI on forecasting accuracy;</p>
      <p>Assessing model accuracy using evaluation metrics such as MSE, RMSE and MAPE.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Neural network architecture with LSTM-blocks</title>
      <p>
        Fig 1. illustrates the architectural design of a recurrent neural network (RNN) [
        <xref ref-type="bibr" rid="ref15">15</xref>
        ], structured with
sequentially connected LSTM units. Each LSTM block processes data at a discrete time step,
accumulating contextual information through inter-block interactions. This architecture enables the
network to refine both its output predictions and internal state updates, ensuring greater accuracy in
long-term forecasting.
      </p>
      <p>The processed output from LSTM blocks is subsequently fed into a fully connected (Dense) layer,
responsible for generating final prediction outputs. Depending on the specific network configuration,
activation functions in LSTM layers may include tanh or sigmoid, while the output Dense layer
employs linear or ReLU, depending on the necessity for output scaling.</p>
      <p>On Fig. 2 illustrates the internal structure of an individual LSTM unit utilized in this research.
(indicating retention), ensuring selective memory update mechanisms cell Сt−1.</p>
      <p>f t=σ (W t∗[ ht−1 , xt ]+bf ) ,</p>
      <p>
        ( 4 )
where:
f t – represents a vector of values in the range [
        <xref ref-type="bibr" rid="ref1">0,1</xref>
        ], specifying the fraction of retained or discarded
information within the memory cell.
      </p>
      <p>W t , bf – denote trainable weight matrices and bias vectors, updated dynamically during the
training process.</p>
      <p>σ – denotes the sigmoid activation function used to regulate information flow.</p>
      <p>2. Input gate — At this stage, the network decides whether to store new information in the current
memory state. Specifically, it determines which input values should be used to modify memory. The
network utilizes the previous hidden state and the sequence value at the current time step, applying
them to a sigmoid function. This process consists of two layers: sigmoid activation layer that
determines which values can be updated and tanh activation layer that generates a vector of new
candidate values for updating the memory cell
it=σ (W i∗[ ht−1 , xt ]+bi) ,</p>
      <p>(5)
Ct=tan h (W C∗[ ht−1 , xt ]+bC ) ,</p>
      <p>(6 )
where:
it – represents activation vector that determines memory updates.</p>
      <p>Ct – represents vector of new candidate values.</p>
      <p>3. Output gate — At this stage, the network processes previously computed and stored
information to generate a new hidden state, deciding what will be returned as the output of the
current memory cell. First, a sigmoid activation layer determines which part of the current state
should be output. Then, the tanh function is applied to compute the candidates for the output state.
Finally, all layers’ results are combined, and only the relevant information is returned.
ot=σ (W 0∗[ ht−1 , xt ]+b0) ,</p>
      <p>(7 )
ht=ot∗tan h (Ct ) ,</p>
      <p>(8)
where:
ot – represents vector of output signal values.
ht – represents updated hidden state, which is passed to the next time step.</p>
      <p>
        The LSTM-block structure [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] is designed to efficiently preserve long-term dependencies by
combining mechanisms for storing essential information and filtering out irrelevant data. This makes
LSTM-blocks one of the most effective tools for time series forecasting.
      </p>
      <p>The core idea is that the learning process occurs within a memory-based context. The network
forgets, learns, and extracts relevant parts of the information for the next step. However, at the next
step, the same process is repeated again. Essentially, this approach attempts to mimic how the human
brain learns and retains information through the internal gating mechanisms of LSTM (although this
is not necessarily an exact representation, it is an attempt to apply different strategies to improve
learning).</p>
    </sec>
    <sec id="sec-5">
      <title>5. LSTM model evaluation metrics</title>
      <p>
        The performance of LSTM models was assessed using the following metrics [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ]:
      </p>
      <p>Mean Squared Error (MSE) – is an indicator that reflects the average of the squared differences
between the actual and predicted values. The use of error squares amplifies the impact of large
deviations, making this metric sensitive to significant errors. Formula for calculation MSE:
1 n
MSE= ∑ ( yi− ^yi)2 ,
n i=0</p>
      <p>(1)</p>
      <p>Root mean squared error (RMSE) – is the square root of MSE, which allows the error to be
expressed in the same units as the actual values. This metric provides an intuitive interpretation of
forecasting accuracy. The RMSE formula is:</p>
      <p>RMSE=√ ∑ ( yi− ^yi)2 ,
1 n
n i=0
(2)</p>
      <p>Mean absolute percentage error (MAPE) – measures the average percentage deviation between
actual and predicted values. This metric evaluates forecasting accuracy independently of scale. The
MAPE formula is:</p>
      <p>MAPE=
1 n y − ^yi|∗100 % . ,</p>
      <p>∑| i
n i=0 yi</p>
      <p>(3)</p>
    </sec>
    <sec id="sec-6">
      <title>6. Computer experiment and analysis of results</title>
      <p>The computer experiment on time series forecasting was conducted based on a neural network
algorithm with LSTM-blocks and the Nadam optimizer, represented in the block diagram in Fig. 3.</p>
      <p>The experiment was performed for two different sets of hyperparameters in the LSTM-based
neural network.</p>
      <p>Case A: First set of parameters:</p>
      <sec id="sec-6-1">
        <title>Number of LSTM-blocks: 300</title>
        <p>Dropout: 0.1
Optimizer: Nadam
Technical indicators: Exponential Moving Average (EMA) and Relative Strength Index (RSI)
were included to enhance the understanding of market trends.</p>
        <p>Case B: Second set of parameters:







</p>
        <p>Number of LSTM-blocks: 350
Dropout: 0.05
Optimizer: Nadam
Technical indicators: Exponential Moving Average (EMA) and Relative Strength Index (RSI)
were included to enhance the understanding of market trends.</p>
        <p>To train the LSTM-based neural network, a dataset was obtained from the publicly available
Yahoo Finance source using the yfinance library. The experiment focused on Google (GOOGL) stock
market data, forming a dataset that spans January 2011 to January 2024. In total, the analyzed time
period includes 4,748 calendar days, while the dataset contains 3,270 records. Each record contains
the following characteristics:
 Open – the opening price of the stock at the beginning of the trading day;
 High – the highest price recorded during the day;
 Low – the lowest price at which the stock was traded during the day;
 Close – the closing price of a stock at the end of the trading session;
 Adj Close – is the adjusted closing price taking into account corporate events;
 Volume – the volume of shares that were sold or bought during the day.</p>
        <p>The data was retrieved using the yfinance library, which provides a convenient interface for
accessing financial data. For this experiment, the “Close” column was selected as it is the most
relevant for time series analysis and forecasting.</p>
        <sec id="sec-6-1-1">
          <title>6.1. Data preparation and neural network training</title>
          <p>The model was implemented in Python programming language, using the following libraries:
 NumPy – for efficient numerical computations.
 pandas – for handling tabular data and preprocessing.
 Matplotlib – for graphical visualization of results.
 keras – a framework for developing and training neural networks.
 yfinance – a library for retrieving historical financial data.</p>
          <p>The dataset was divided into training and test samples in the ratio of 80:20. The Min-Max Scaling
method was used to normalize the values. The dataset was prepared in such a way that each forecast
was formed on the basis of 60 previous time points. The scaling was performed using the Min-Max
Scaler, which contributes to stable model training.</p>
          <p>Fig. 4 (a, b) presents the results of the computer experiment on stock price forecasting using an
LSTM-based neural network with the first (Case A) and second (Case B) sets of hyperparameters. Fig.
5 (a, b) illustrates the dependency of MAPE metric values on the number of LSTM-blocks for Cases A
and B. Fig. 6 (a, b) visualizes the MSE (Mean Squared Error), RMSE (Root Mean Squared Error), and
MAPE (Mean Absolute Percentage Error) metrics using histograms.</p>
          <p>a. Case A; b. Case B;
Figure 4 (a, b): Stock price forecast graphs for the first and second sets of parameters.


</p>
          <p>Blue line: Training data.</p>
          <p>Yellow line: Validation data.</p>
          <p>Green line: Predicted values on validation.</p>
          <p>a. Case A; b. Case B;
Figure 5 (a, b): Dependency of MAPE metric values on the number of LSTM-blocks for cases A and
B.</p>
          <p>a. Case A – for 275 LSTM-blocks b. Case B – for 325 LSTM-blocks
Figure 6 (a, b): Visualization of MSE, RMSE and MAPE metrics using histograms.</p>
          <p>Significantly higher MAPE values were observed when using fewer LSTM-blocks (50–100). A
more gradual decrease in MAPE with an increasing number of LSTM-blocks indicates the stability of
the neural network.</p>
          <p>The network morphology in Case A is well-suited for stock price forecasting due to its low error
rate and stable predictions. The choice of 300 LSTM-blocks and Dropout 0.1 ensures an optimal
balance between model complexity and overfitting prevention. However, despite achieving good
accuracy (MAPE = 1.75%), this neural network lags behind Case B in performance.</p>
          <p>The network morphology in Case B (350 LSTM-blocks, Dropout 0.05) demonstrated a consistent
MAPE value across 180–400 LSTM-blocks, indicating strong generalization capability. In particular,
the Case A configuration (300 LSTM-blocks, Dropout 0.1) resulted in minimal MAPE values (~1.64%).
Reducing the Dropout rate to 0.05 in Case B helped prevent excessive weight nullification, positively
impacting prediction accuracy. This neural network (Case B) outperformed the model from Case A,
showing higher efficiency but also greater sensitivity to overfitting with a large number of
LSTMblocks (&gt;350). The lowest MAPE value was observed in Case B with 325 LSTM-blocks, indicating that
this configuration achieved the highest accuracy and stability. Thus, the best-performing network
had 325 LSTM-blocks and a Dropout of 0.05, yielding the lowest MAPE (~1.64%) while minimizing the
risk of overfitting.</p>
          <p>Histograms (Fig. 6 a, b) provide a visual representation of forecasting accuracy for the neural
network models across three key metrics: MSE (Mean Squared Error), RMSE (Root Mean Squared
Error) and MAPE (Mean Absolute Percentage Error).</p>
          <p>For the first set of hyperparameters (Case A):
 MSE = 6.57
 RMSE = 2.56
 MAPE = 1.75%</p>
        </sec>
      </sec>
      <sec id="sec-6-2">
        <title>For the second set of hyperparameters (Case B):</title>
        <p>

</p>
        <p>The experimental results confirmed that using LSTM-based neural networks significantly
improves time series forecasting accuracy compared to traditional approaches such as ARIMA and
GRU.</p>
        <p>In particular, the integration of technical indicators (EMA and RSI) with adaptive optimizers
enabled the models to better adapt to complex fluctuations in time series, resulting in more accurate
predictions.</p>
        <p>Advantages of the proposed LSTM-based neural network in case B configuration:
 High accuracy: The MAPE of 1.64% confirms the model's ability to provide precise forecasts,
even in the presence of stochastic fluctuations in the time series.
 Robustness to noise: The use of technical indicators allows the model to process time series
data more effectively.
 Flexibility: The ability to adjust the Dropout rate and the number of LSTM-blocks makes the
model adaptable to different forecasting tasks and datasets.</p>
        <sec id="sec-6-2-1">
          <title>6.2. Analysis of the impact of the number of LSTM-blocks and Dropout</title>
          <p>During the experiments, the impact of different LSTM-block counts (100, 200, 300, 400) and Dropout
levels (0.1, 0.2, 0.3) on the accuracy of Google stock price forecasting was analyzed.</p>
          <p>Dropout is a regularization method [18] used to prevent overfitting in a neural network by
randomly deactivating (zeroing out) a portion of neurons during training. In our LSTM model,
Dropout was applied twice:</p>
          <p>After the first LSTM layer (Dropout Layer 1):


10% of neurons were deactivated before passing to the next LSTM layer.</p>
          <p>This reduces dependencies between neurons and improves the network’s generalization
ability.</p>
        </sec>
      </sec>
      <sec id="sec-6-3">
        <title>After the second LSTM layer (Dropout Layer 2):</title>
        <p> Another 10% of neurons were deactivated before passing to the final Dense layer.
 This helps prevent excessive adaptation of the model to the training data.</p>
        <p>Thus, Dropout improves the model’s robustness to input data variability and enhances its
generalization on test data.</p>
        <p>1. Validation Loss vs. LSTM-blocks (Fig. 7) – This graph illustrates the change in validation loss
depending on the number of LSTM-blocks and Dropout values:
 Increasing the number of LSTM-blocks up to 200 helps minimize validation loss.
 At 300 LSTM-blocks, the model exhibits the lowest loss values when Dropout 0.2, indicating
optimal stability.
 Dropout 0.3 leads to significant fluctuations, suggesting weaker generalization ability of the
model.</p>
        <p>2. Training Time vs. LSTM-blocks (Fig. 8) – This graph shows that increasing the number of
LSTM-blocks directly impacts the model's training time:
 There is an almost linear relationship between the number of LSTM-blocks and training time.
 Dropout has a minimal effect on training time, but minor differences can be observed when
the number of blocks exceeds 200.</p>
        <p>Fig. 9 presents a 3D-visualization of the stability analysis of LSTM models based on validation loss
in the coordinates: number of LSTM-blocks and Dropout.</p>
        <p>Optimal Dropout values (0.05–0.1) significantly reduce validation loss during time series
forecasting.
 The LSTM model with 300 blocks demonstrates the best performance in validation
forecasting.</p>
        <p>The analysis of experimental results confirms that proper tuning of LSTM parameters [19],
specifically the number of blocks and Dropout, can significantly improve model accuracy and
stability.</p>
        <sec id="sec-6-3-1">
          <title>6.3. Impact of technical indicators (EMA, RSI) on forecast accuracy</title>
          <p>3D-visualization of technical parameter influence on forecasting</p>
        </sec>
      </sec>
      <sec id="sec-6-4">
        <title>Trend analysis of Close, EMA, and RSI for LSTM models</title>
      </sec>
    </sec>
    <sec id="sec-7">
      <title>7. Conclusions</title>
      <p>The architecture of a neural network with LSTM-blocks and its training algorithm were optimized
using the Nadam optimizer for time series forecasting and analysis of the impact of hyperparameters
and technical indicators on forecasting accuracy.</p>
      <p>A block diagram of the neural network algorithm with different numbers of LSTM-blocks and
hyperparameter configurations was developed for time series forecasting.</p>
      <p>Based on the conducted experiments, the role of the number of LSTM-blocks, Dropout levels, and
technical indicators (EMA and RSI) was analyzed:
 The optimal configuration was achieved with 300–350 LSTM-blocks and Dropout values in
the range of 0.05–0.1, minimizing prediction errors.
 EMA_20 was identified as the key predictor for closing price forecasting, whereas RSI
exhibited a weaker correlation, but can be useful for detecting anomalous market movements.
 Training time increases linearly with the number of LSTM-blocks.
 The Nadam optimizer ensured stable model training.
 The EMA_20 trend almost perfectly follows the Close price trend, confirming its efficiency in
forecasting.
 3D-vizualization of validation loss demonstrated that Dropout = 0.3 is less effective, as it
reduces prediction accuracy.</p>
      <p>Practical implications of the study:
 The proposed model can be applied to mine clearance operations, including temporal analysis
of georadar and magnetometer data, as well as energy forecasting in the Industry 4.0 era,
stock prices, currency exchange rates, sales volume predictions, product demand, and other
time series tasks.
 The study established that using 325 LSTM-blocks is optimal, achieving a minimum forecast
error (MAPE = 1.64%), surpassing previous studies where the error exceeded 1.8%.
 This model can also be adapted for forecasting drone trajectories, meteorological changes,
and object recognition based on electromagnetic signals.
 It was confirmed that applying the Nadam optimizer and low Dropout values (0.05–0.1)
ensures training stability and high-speed model learning.</p>
      <p>Thus, this study confirms that a properly optimized LSTM architecture, incorporating the optimal
number of blocks, Dropout levels, and technical indicators, can significantly enhance the accuracy of
time series forecasting. The results obtained open new opportunities for applying LSTM networks in
financial analysis, market trend forecasting, and artificial intelligence tasks. Additionally, the
proposed architectural and morphological solutions can be directly applied to predicting the
trajectories of drones and forecasting the potential movement of mines due to weather and geological
factors, as well as optimizing resource planning in demining missions.</p>
    </sec>
    <sec id="sec-8">
      <title>Acknowledgements</title>
      <p>The research was carried out with the grant support of the National Research Fund of Ukraine
"Methods and means of active and passive recognition of mines based on deep neural networks",
project registration number 273/0024 from 1/08/2024 (2023.04/0024). Also, we would like to thank the
reviewers for their precise and concise recommendations that improved the presentation of the
results obtained.</p>
    </sec>
    <sec id="sec-9">
      <title>Declaration on Generative AI</title>
      <sec id="sec-9-1">
        <title>The authors have not employed any Generative AI tools.</title>
        <p>[18] A Theoretically Grounded Application of Dropout in Recurrent Neural Networks. Advances in
Neural Information Processing Systems (NeurIPS), 2016; 29.
ttps://doi.org/10.48550/arXiv.1512.05287
[19] Nelson, D. M., Pereira, A. C. M., &amp; de Oliveira, R. A. Stock market's price movement prediction
with LSTM neural networks. International Joint Conference on Neural Networks (IJCNN), 2017;
1419-1426. https://doi.org/10.1109/IJCNN.2017.7966019</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Abbasimehr</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paki</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <article-title>Improving time series forecasting using LSTM and attention models</article-title>
          .
          <source>J Ambient Intell Human Comput</source>
          <year>2022</year>
          ;
          <volume>13</volume>
          ,
          <fpage>673</fpage>
          -
          <lpage>691</lpage>
          . https://doi.org/10.1007/s12652-020-02761-x
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Fischer</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Krauss</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          <article-title>Deep learning with long short-term memory networks for financial market predictions</article-title>
          .
          <source>European Journal of Operational Research</source>
          ,
          <year>2018</year>
          ;
          <volume>270</volume>
          (
          <issue>2</issue>
          ),
          <fpage>654</fpage>
          -
          <lpage>669</lpage>
          . https://doi.org/10.1016/j.ejor.
          <year>2017</year>
          .
          <volume>11</volume>
          .054.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Bao</surname>
            <given-names>W.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Yue</surname>
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rao</surname>
            <given-names>Y.</given-names>
          </string-name>
          <article-title>A Deep Learning Framework for Financial Time Series Using Stacked Autoencoders and Long-Short Term Memory</article-title>
          .
          <source>PLoS ONE</source>
          <volume>12</volume>
          (
          <issue>7</issue>
          ):
          <fpage>e0180944</fpage>
          .
          <year>2017</year>
          ; https://doi.org/10.1371/journal.pone.
          <volume>0180944</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>Abbasimehr</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Paki</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          <article-title>Improving Time Series Forecasting Using LSTM and Attention Models</article-title>
          .
          <source>Proceedings of the International Conference on Machine Learning. Journal of Ambient Intelligence and Humanized Computing</source>
          <year>2022</year>
          ;
          <volume>13</volume>
          ,
          <fpage>673</fpage>
          -
          <lpage>691</lpage>
          . https://doi.org/10.1007/s12652-020- 02761-x
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <surname>Kurniawan</surname>
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Indrabayu</surname>
          </string-name>
          , Yusuf M.
          <article-title>Stock Price Prediction Using Technical Data</article-title>
          and
          <string-name>
            <given-names>Sentiment</given-names>
            <surname>Score</surname>
          </string-name>
          .
          <source>2024 IEEE International Conference on Industry 4</source>
          .0,
          <string-name>
            <given-names>Artificial</given-names>
            <surname>Intelligence</surname>
          </string-name>
          ,
          <source>and Communications Technology (IAICT)</source>
          .
          <year>2024</year>
          ; https://doi.org/10.1109/IAICT62357.
          <year>2024</year>
          .10617768
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Peter</surname>
            <given-names>T.</given-names>
          </string-name>
          <string-name>
            <surname>Yamak</surname>
            ,
            <given-names>Li</given-names>
          </string-name>
          <string-name>
            <surname>Yujian</surname>
          </string-name>
          , and
          <string-name>
            <surname>Pius</surname>
            <given-names>K.</given-names>
          </string-name>
          <string-name>
            <surname>Gadosey</surname>
          </string-name>
          .
          <article-title>A Comparison between ARIMA, LSTM, and GRU for Time Series Forecasting</article-title>
          .
          <source>ACAI '19: Proceedings of the 2019 2nd International Conference on Algorithms, Computing and Artificial Intelligence</source>
          .
          <year>2020</year>
          ; https://doi.org/10.1145/3377713.3377722
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Livieris</surname>
            ,
            <given-names>I. E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pintelas</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Pintelas</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          “
          <article-title>A CNN-LSTM model for gold price time-series forecasting</article-title>
          .
          <source>” Neural Computing and Applications</source>
          ,
          <year>2020</year>
          ;
          <volume>32</volume>
          ,
          <fpage>17351</fpage>
          -
          <lpage>17360</lpage>
          . https://doi.org/10.1007/s00521-020-04867-x
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <surname>Smyl</surname>
            ,
            <given-names>S. “</given-names>
          </string-name>
          <article-title>A hybrid method of exponential smoothing and recurrent neural networks for time series forecasting</article-title>
          .”
          <source>International Journal of Forecasting</source>
          ,
          <year>2020</year>
          ;
          <volume>36</volume>
          (
          <issue>1</issue>
          ),
          <fpage>75</fpage>
          -
          <lpage>85</lpage>
          . https://doi.org/10.1016/j.ijforecast.
          <year>2019</year>
          .
          <volume>03</volume>
          .017
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <surname>Makridakis</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          et al. “
          <article-title>The M5 competition: Background, methods and results</article-title>
          .”
          <source>International Journal of Forecasting</source>
          ,
          <year>2022</year>
          ;
          <volume>38</volume>
          (
          <issue>3</issue>
          ),
          <fpage>897</fpage>
          -
          <lpage>906</lpage>
          . https://doi.org/10.1016/j.ijforecast.
          <year>2021</year>
          .
          <volume>07</volume>
          .007
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Zhang</surname>
            ,
            <given-names>G. P.</given-names>
          </string-name>
          “
          <article-title>Forecasting inflation using univariate continuous-time stochastic models</article-title>
          .
          <source>” Journal of Forecasting</source>
          ,
          <year>2019</year>
          ;
          <volume>38</volume>
          (
          <issue>8</issue>
          ),
          <fpage>655</fpage>
          -
          <lpage>676</lpage>
          . https://doi.org/10.1002/for.2603
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Zhou</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          et al. “
          <article-title>Informer: Beyond efficient transformer for long sequence time-series forecasting</article-title>
          .
          <source>” AAAI Conference on Artificial Intelligence</source>
          ,
          <year>2021</year>
          ;
          <volume>35</volume>
          (
          <issue>12</issue>
          ),
          <fpage>11106</fpage>
          -
          <lpage>11115</lpage>
          . https://doi.org/10.1609/aaai.v35i12.
          <fpage>17325</fpage>
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <surname>Kim</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Won</surname>
            ,
            <given-names>C. H. Forecasting</given-names>
          </string-name>
          <article-title>the volatility of stock price index: A hybrid model integrating LSTM with multiple GARCH-type models</article-title>
          .
          <source>Expert Systems with Applications</source>
          ,
          <year>2018</year>
          ;
          <volume>103</volume>
          ,
          <fpage>25</fpage>
          -
          <lpage>37</lpage>
          . https://doi.org/10.4108/eai.6-1-
          <year>2023</year>
          .2330313.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <surname>Peleshchak</surname>
            <given-names>I. Lytvynenko</given-names>
          </string-name>
          <string-name>
            <surname>Yu</surname>
          </string-name>
          .
          <article-title>Vysokotochne prohnozuvannia chasovykh riadiv</article-title>
          .
          <source>Proceedings of the 8th International Scientific</source>
          and Practical Conference «International Scientific Discussion: Problems, Tasks and Prospects».
          <year>2024</year>
          ; https://doi.org/10.51582/interconf.19-
          <fpage>20</fpage>
          .
          <fpage>05</fpage>
          .
          <year>2024</year>
          .063
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <surname>Peleshchak</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Futryk</surname>
            <given-names>Y.</given-names>
          </string-name>
          <article-title>Time series forecasting using a neural network with serially connected LSTM blocks</article-title>
          . Herald of Khmelnytskyi National University.
          <source>Technical Sciences</source>
          ,
          <year>2025</year>
          ;
          <volume>347</volume>
          (
          <issue>1</issue>
          ),
          <fpage>432</fpage>
          -
          <lpage>441</lpage>
          . https://doi.org/10.31891/
          <fpage>2307</fpage>
          -5732-2024-347-1-59
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <surname>Bishesh</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          <article-title>Neural Networks for Big Data Analytics</article-title>
          . In M. 
          <string-name>
            <surname>Mangla</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
           
          <string-name>
            <surname>Satpathy</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
           
          <string-name>
            <surname>Nayak</surname>
            &amp;
            <given-names>S. N.</given-names>
          </string-name>
          <string-name>
            <surname>Mohanty</surname>
          </string-name>
          (Eds.),
          <source>Integration of Cloud Computing with Internet of Things: Foundations, Analytics, and Applications</source>
          <year>2021</year>
          ; (pp. 
          <fpage>277</fpage>
          -
          <lpage>298</lpage>
          ). https://doi.org/10.1002/9781119769323.ch16
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <surname>Farrag</surname>
            ,
            <given-names>Tamer</given-names>
          </string-name>
          &amp; Elattar, Ehab.
          <article-title>Optimized Deep Stacked Long Short-Term Memory Network for Long-Term Load Forecasting</article-title>
          .
          <source>IEEE Access</source>
          <year>2021</year>
          ;
          <volume>9</volume>
          ,
          <fpage>68511</fpage>
          -
          <lpage>685222021</lpage>
          ; http://dx.doi.org/10.1109/ACCESS.
          <year>2021</year>
          .3077275
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <surname>Chicco</surname>
            <given-names>D</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Warrens</surname>
            <given-names>MJ</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jurman</surname>
            <given-names>G.</given-names>
          </string-name>
          <article-title>The coefficient of determination R-squared is more informative than SMAPE, MAE, MAPE, MSE and RMSE in regression analysis evaluation</article-title>
          .
          <source>PeerJ Comput. Sci</source>
          .
          <volume>7</volume>
          : e 623. -
          <fpage>2021</fpage>
          . https://doi.org/10.7717/peerj-cs.
          <fpage>623</fpage>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>