## 2 Model Introduction
### AWOA-DBiLSTM Neural Network Modeling
#### 2.4.1 DBiLSTM Neural Network  
In this paper, the historical trajectory (longitude, latitude, and altitude) and physical attitude (pitch angle, yaw angle, and roll angle) of the AUV are separately extracted to obtain data features. These features are then input into different BiLSTM layers. By employing two BiLSTM layers to extract features separately, the model's representational capacity can be enhanced, and its flexibility can also be increased. Each BiLSTM layer performs forward and backward processing on the input sequence to capture more contextual information. Within DBiLSTM, the first BiLSTM layer gathers features pertaining to the AUV's physical attitude, and the second layer integrates the physical attitude features gleaned by the first BiLSTM layer with features gathered from the AUV's positional data.  
Figure 6: BiLSTM neural network.  
In order to filter and reset the data features recovered by the first BiLSTM layer through information filtering and resetting, a gating mechanism is placed between the two BiLSTM layers. The hierarchical feature abstraction process helps the model learn more abstract and semantically rich representations, which improves its ability to extract essential features from the input sequence. DBiLSTM improves the input sequence's resistance to noise, variations, and interferences. It also lengthens the information's transmission path through the network, enabling more seamless information flow between different network layers. The DBiLSTM's structure is shown in Figure 7.  
Firstly, the output of the first layer is processed through a gating mechanism and then used as the input for the second layer. The output of the first layer is \(h^{(1)}\), which is filtered by the gating mechanism before fusing the layer information with the second layer feature information. A gating mechanism is added between the two layers to control the transfer of information using update gates and reset gates; the control parameters of these gates can be learned by the neural network to control the degree of influence of the output \(h^{(1)}\) of the first layer on the input \(x_{(2)}^{n}\) of the second layer. It can be computed using the sigmoid function, denoted as  
\[z=\sigma\big{(}W_{z}\cdot\big{[}h^{(1)},x_{(2)}^{n}\big{]}+b_{z}\big{)} \tag{12}\]  
where \(W_{z}\) is the weight matrix of the update gate, \(b_{z}\) is the bias vector, and \(\sigma\) is the sigmoid function. The reset gate r controls how the output \(h^{(1)}\) of the first layer is mixed with the input \(x_{(2)}^{n}\) of the second layer. It can be computed using sigmoid functions as well:  
\[r=\sigma(W_{r}\cdot\big{[}h^{(1)},x_{(2)}^{n}\big{]}+b_{r}) \tag{13}\]  
The weighted inputs are then performed and the reset first layer output \(\tilde{h}^{(1)}\) is computed based on the result of the reset gate. This step is to decide which first layer information is to be retained and is calculated as follows:  
\[\tilde{h}^{(1)}=\tanh\big{(}W_{h}\cdot\big{[}r\odot h^{(1)},x_{(2)}^{n}\big{]} +b_{h}\big{)} \tag{14}\]  
\(W_{h}\) is the matrix of the reset output and \(b_{h}\) is the bias vector. To update the state of the second layer, based on the result of updating the gate, \(z\), and the reset output of the first layer, \(\tilde{h}^{(1)}\), one should update the state of the hidden layer of the second layer, \(h^{(2)}\):  
\[h^{(2)}=(1-z)\odot h^{(2)}+z\odot\tilde{h}^{(1)} \tag{15}\]  
Figure 7: DBiLSTM neural network.  
Through the control of the gating mechanism, the hidden state of the second layer can be updated according to the output of the first layer, thus realizing information transfer and control between the two layers. The model's generalization ability and performance can be enhanced by incorporating the computational principle of the gating mechanism between the two layers. This mechanism can enable the model to better adapt to various data distributions and task requirements.