## 2 Model Introduction
### AWOA-DBiLSTM Neural Network Modeling
#### 2.4.2 Adaptive Whale Optimization Algorithm (AWOA)
A whale executing spiral encirclement moves towards its prey in a spiral trajectory while simultaneously constricting the encirclement. By probabilistically selecting the contraction envelopment mechanism for \(Pi\) and the spiral model for \(1-Pi\) to update the whale's position, the mathematical model is represented as follows:  
\[X(t+1)= \begin{cases}X(t)_{best}-AD,p<P_{i}\\ X(t)=X(t)_{best}+D_{p}e^{bl}\cos{(2\pi l)}\end{cases}  \tag{22}\]  
When attacking the prey, the mathematical model is set close to the prey to decrease the value of a. The position of \(A\) changes with the change in a. During iteration, when the value decreases from 2 to 0, \(A\) is a random value within [\(-\)a, a]; when \(A\) is in [\(-1\), 1], the next position of the whale is any position between the present position and the position of the prey. The algorithm is set so that the whale launches an attack when \(A<1\). AWOA chooses the updating mechanism based on a threshold \(Q\) in the random search stage to prevent becoming stuck in local optima. The definition of the probability threshold is as follows:  
\[Q=\frac{\left|\overline{f}-f_{min}\right|}{\left|f_{max}-f_{min}\right|} \tag{23}\]  
where \(\overline{f}\) denotes the average fitness value of the current population, \(f_{min}\) is the current best fitness value, and \(f_{max}\) is the current worst fitness value. For whale individuals, a random number \(q\) between [0, 1] is compared numerically with a calculated probability threshold \(Q\). If \(q<Q\), the randomly selected whale individual \(X_{rand}\) is updated with its position according to the following formula, while the other individuals remain unchanged:  
\[X_{rand}=X_{j\;\min}+r\cdot(X_{j\;\max}-X_{j\;\min}) \tag{24}\]  
where \(X_{j\;\max}\) and \(X_{j\;\min}\) are the maximum and minimum values of the variable \(X_{rand}\), respectively, and \(r\) is a random number between [0, 1]. AWOA optimizes the whole process through adaptive weight adjustment, and the calculation principle is as follows:  
\[\omega_{1}=\omega_{min}+DP\cdot(\omega_{max}-\omega_{min}),\frac{t}{T_{max}} \leq 0.5 \tag{25}\]  
\[\omega_{2}=\omega_{\max}-(\omega_{\max}-\omega_{\min})\times\frac{\text{rank}( r)}{N},\frac{t}{T_{\max}}>0.5 \tag{26}\]where \(\omega_{max}\) denotes the maximum inertia weight, \(\omega_{min}\) denotes the minimum inertia weight, \(DP\) denotes the success rate of individual optimization in the algorithm, \(rank(r)\) denotes the order number of random individuals, and \(N\) denotes the population size. The global and local optimization searches are more evenly balanced as the iteration goes on because the inertia weights are dynamically adjusted. The weights cannot be updated if the optimization success rate (\(DP\)) is kept constant in the second half of the individual aggregation iteration. Instead, the order number of randomly selected individuals is used to update the weights, and the search step size is somewhat increased to prevent a local optimum. When \(\frac{t}{T_{max}}<0.5\), the weight update formula is added as  
\[X(t+1)=X(t)_{best}-\omega_{1}\cdot A\cdot D\quad|A|<1,p<0.5 \tag{27}\]  
\[X(t+1)=X_{rand}-\omega_{1}\cdot A\cdot D_{rand}\quad|A|\geq 1,p<0.5 \tag{28}\]  
When \(\frac{t}{T_{max}}\geq 0.5\), then the position update mathematical model is  
\[X(t+1)=D^{\prime}\cdot e^{bl}\cdot\cos(2\pi l)+\omega_{1}\cdot X(t)_{best},p \geq 0.5 \tag{29}\]  
In the entire optimization process, the first half of the adaptive adjustment of weights primarily regulates the population when the number of iterations is large, while the second half plays a role in preventing the population from falling into local optima. The AWOA algorithm was employed to optimize the neural network. Firstly, the neural network parameters were treated as candidate solutions in the solution space. Using the initialization method of the AWOA, a random set of neural network parameters was generated as the initial population.