## 4 BP Neural Network and Pearson Correlation Analysis
### Model Setting  
#### 4.1.1 Principles of Mathematics  
The BPNN features a multi-layered architecture, as illustrated in Figure 2, comprising input/output and hidden layers [19]. In this structure, computations are iteratively performed through forward propagation from the input layer to the output layer, while the weights and biases are adjusted via backward propagation until the loss function reaches its minimum value. In Figure 2, the details are outlined as follows:  
* First, L represent the number of neurons in the hidden layer and N denote the number of neurons in the input layer, with M signifying the number of neurons in the output  
Figure 2: Typical structure of BPNN. layer. The index i for the input layer ranges from 1 to N, while index j spans from 1 to L in the hidden layer;
* Second, the input layer consists of parameters such as the cylinder group volume and gas pressure, gas pipeline length and inner diameter, sea valve inner diameter, blowing duration, sea tank back pressure, ballast water tank level considerations, temperature variations, and the gas volume within the ballast tank; thus, N is set at 10, with X\({}_{1}\) to X\({}_{\text{N}}\) representing these corresponding inputs;
* Third, Hj(t) denotes the output from each neuron in the jth hidden layer with specific weights assigned between this hidden layer and other layers. The computation for Hj(t) is expressed below: \[\text{Hj}(\text{t})=\text{f}\left(\sum_{\text{i}=1}^{\text{N}}\omega_{\text{ ij}}\cdot\text{x}_{\text{i}}(\text{t})+\alpha_{\text{j}}\right)\] (13)  
In Equation (13), \(\omega_{\text{ij}}\) represents the connection weight between the ith neuron in the input layer and the jth neuron in the hidden layer, while \(\alpha_{\text{j}}\) denotes the bias associated with the jth hidden-layer neuron. The term \(\text{x}_{\text{i}}(\text{t})\) refers to the input of the ith neuron layer at time t. Additionally, \(\alpha_{\text{j}}\) denotes the bias of the hidden-layer neuron as jth, and f(x) signifies a nonlinear activation function for the hidden layer that facilitates mapping learning capabilities, with common examples including sigmoid, Gaussian, and ReLU functions. Generally, the hyperbolic tangent sigmoid activation function is selected for its S-shaped curve and is expressed as follows:  
\[\text{f}(\text{x})=\frac{1}{1+\text{e}^{-\text{x}}} \tag{14}\]  
To ensure the effective training of a BPNN, it is essential to appropriately configure the training algorithm. The Levenberg-Marquard method, noted for its rapid convergence rate, is frequently employed [28];  
* Fourth, the drainage percentage of the ballast tank is selected as the output result sampled by the output layer; thus, M is assigned a value of 1. The output from the BPNN, denoted as Y\({}_{\text{BP}}\)(t), can be calculated using the following equation: \[\text{Y}_{\text{BP}}(\text{t})=\sum_{\text{j}=1}^{\text{L}}\left[\omega_{\text {j}}\cdot\text{Hj}(\text{t})+\text{b}\right]\] (15)  
In Equation (15), \(\omega_{\text{j}}\) represents the weight connecting the jth neuron in the hidden layer to the output-layer neuron, while b denotes the bias of the output layer. The value of L is specified as follows:  
\[\text{L}=\sqrt{\text{N}+\text{M}}+\text{a} \tag{16}\]  
In Equation (16), the parameter a is constrained between 1 and 10, which must be validated until the mean square error of the neural network falls below the target training goal [20];  
* Fifth, function L (\(\omega\), b, X, Y) is defined to quantify the loss between Y\({}_{\text{BP}}\)(t) and the actual value Y: \[\text{L}(\omega,\text{b},\text{X},\text{Y})=\frac{1}{2}\cdot(\text{Y}-\text{ Y}_{\text{BP}})^{2}\] (17)  
In Equation (17), Y represents the actual value produced by the BPNN, while YBP denotes the predicted value generated by the BPNN. Through backpropagation, the weights and biases of the various layers are updated via chain iterations as below:\[\left\{