## 3 Proposed Model
### Stage 3: SA Use in Parameter Tuning  
SA was used in this study to tune the parameters. SA is a novel SI optimizer based on the swarming behavior of dragonflies when they hunt and migrate [50; 51]. The individuals within the swarm alter their location according to five main factors, i.e., alignment, attraction, distraction, cohesion, and separation. The average of neighboring locations is used for alignment; attraction is expressed in terms of the distance to distraction; cohesion is expressed as the variance between the individual's location and alignment; and separation is the sum of the distance between each location and others. The total of the enemy, which is the worst performance, and the different locations are taken as the food sources, which are considered the fittest solutions. The following equation illustrates the location where the individual swarm is updated.  
\[x_{i}^{t+1}=x_{i}^{t}+\Delta x_{i}^{t+1} \tag{6}\]  
where \(x_{i}^{t}\) represents the current position of the \(i^{th}\) individuals at iteration \(t\), and \(\Delta x_{i}^{t+1}\) denotes the step vector for the next iteration:  
\[\Delta x_{i}^{t+1}=(sS_{i}+aA_{i}+cC_{i}+fF_{i}+eE_{i})+w\Delta x_{i}^{t} \tag{7}\]  
In Equation (7), \(F_{i},S_{j},A_{j},E_{i}\), and \(C_{j}\) represent the values for attraction, separation, alignment, distraction, and cohesion, respectively. The symbol \(w\) stands for inertia weight, while \(c,\ s,\ f,\ a\), and \(e\) are the cohesion, separation, attraction, alignment, and distraction coefficients, respectively. Within a certain radius are neighborhoods, and this radius can be expanded during the iterations to explore the global optima. If there are no further DFs within the location, random walking is used by the DFs, as shown in Equation (8).  
\[x_{i}^{t+1}=x_{i}^{t}+Levy(d)\times x_{i}^{t} \tag{8}\]  
where \(d\) is the searching space size, and \(levy(\cdot)\) refers to the Levy flight process. The smaller radius can use a lower cohesion weight and higher alignment. When the iteration is performed, the smaller the alignment, the larger the cohesion and the bigger the radius. As a result, it is necessary to update the parameter until the ending condition is met.  
In this study, SA was specifically used to optimize the following hyperparameters of the GA-HDLAD model:  
* The learning rate of the deep learning model.
* The number of layers and units in the hidden layers of the RNNs.
* The dropout rate for regularization.  
SA was applied iteratively to adjust these parameters in a way that balances model accuracy and generalization while minimizing overfitting. The objective was to reduce the classification error rate, as represented by the fitness function in Equation (9). By using SA, the hyperparameters were fine-tuned more efficiently than traditional methods such as grid search or random search, which are computationally expensive and may miss the global optima. SA's stochastic nature allowed for a more thorough exploration of the hyperparameter space, improving the model's stability and performance.  
The SA approach achieves a good outcome by progressing an FF. A positive integer is obtained for identifying the optimal outcome from all of the candidate outcomes. As illustrated in Equation (9), a decrease in classifier errors can be considered FF.  
\[\begin{array}{ll}fitness(x_{i})&=ClassifierErrorRate(x_{i})\\ &=\frac{No.of\text{miscal}\text{miscal}\text{miscal}}{TotalNo.of\text{miscal }}\ *\ 100\end{array} \tag{9}\]