## 2 Problem Description and Methods
### Prediction and Optimization Methods
#### 2.2.2. Whale Optimization Algorithm  
In this paper, the Whale Optimization Algorithm (WOA) is used to optimize the training hyperparameters, the number of hidden neurons, and the learning rate of Attention-BILSTM. The WOA [33,37] simulates one of the four predatory behaviors of humpback whales--bubble net predation. When a humpback whale feeds on a school of fish, one or more whales can simultaneously send out bubbles to encircle the fish school like a net and then continue to narrow the bubble net, eventually trapping the school of fish in a small area, flushing it from the bottom up, and swallowing it in one gulp. It has the advantages of strong search capability, fast convergence, and few adjustment parameters and is widely used to solve various optimization problems. The WOA consists of three behaviors: \"Surround the prey\", \"Spiral bubble type attack on prey\", and \"Search for prey\". 1. [leftmargin=*]
2. Surround the prey: After the prey is found, the whales first approach and surround the prey. The fitness value of the whale group is calculated according to the target function, and the position of the whale with the highest fitness value is considered as the position of the target prey, and the other whales move their positions according to the position of the target prey. The target function is the function to be optimized, which can be represented by a loss function. In this stage, the position of the whale is updated according to Equations (8) and (9), where \(\overset{\rightarrow}{X}\) is the position vector of the whale, \(\overset{\rightarrow}{X}\) is the position vector of the whale with the highest current fitness, and \(\overset{\rightarrow}{D}\) is the distance between the whale and the prey. \(\overset{\rightarrow}{A}\) and \(\overset{\rightarrow}{C}\) are coefficients specified in Equations (10) and (11), where \(\overset{\rightarrow}{r_{1}}\) and \(\overset{\rightarrow}{r_{2}}\) are random vectors in the interval [0, 1]. \(\overset{\rightarrow}{a}\) is a vector decreasing from 2 to 0, as in Equation (12), where \(T_{max}\) is the maximum number of iterations: \[\overset{\rightarrow}{D}=\left|\overset{\rightarrow}{C}\overset{\rightarrow} {X}^{*}(t)-\overset{\rightarrow}{X}(t)\right|,\] (8) \[\overset{\rightarrow}{X}(t+1)=\overset{\rightarrow}{X}^{*}(t)-\overset{ \rightarrow}{A}\overset{\rightarrow}{D},\] (9) \[\overset{\rightarrow}{A}=2\overset{\rightarrow}{a}\overset{\rightarrow} {r_{1}}-\overset{\rightarrow}{a},\] (10) \[\overset{\rightarrow}{C}=2\overset{\rightarrow}{r_{2}},\] (11)  
Figure 4: The structure of the BILSTM. \[\overrightarrow{a}=2-\frac{2t}{T_{max}}, \tag{12}\]
2. Spiral bubble type attack on prey: During this stage, the whales continue the behavior of the encircling stage. The whales swim according to the position of the whales with the highest fitness in the group, continuously encircling and contracting. During this process, the coefficient vector \(\overrightarrow{A}\) decreases with the decreasing vector \(\overrightarrow{a}\). In addition, the whales swim in a spiral pattern and blow bubbles, at which point the whales spiral to approach their prey based on the distance between the individual and the whale with the best fitness in the group.