3.2.2. Optimization of BP Neural Network Algorithm

During the calculation process, the selection of the number of neurons in the hidden layer significantly impacts the model's calculation accuracy and speed. The more neurons in the hidden layer, the higher the model's accuracy, but the slower the computation speed. On the contrary, the smaller the number of neurons, the lower the computational accuracy of the model, but the faster the model operates. As a result, it is critical to reasonably determine the number of neurons in the hidden layer, which not only preserves a certain accuracy in the model but also increases its computational speed. According to the relevant literature [32], the number of neurons in the model can be calculated using the following formula:

$$Q = \sqrt{M+N} + A \tag{8}$$

where *Q* is the number of neurons in the hidden layer, *M* is the number of neurons in the input layer, *N* is the number of neurons in the output layer, and *A* is an integer between 1 and 10.

Considering the influence of overfitting and underfitting, after repeated debugging, *Q* is 10, and the test accuracy of the model is the highest. The calculation process of the entire model is shown in Figure 4.

**Figure 4.** Process of the SSA-BP model.

Figures 5 and 6 demonstrate the prediction results of the SSA-BP neural network and the BP neural network. Figures 7 and 8 show that the SSA-BP model has a high R<sup>2</sup> (0.93) and the lowest RMSE (0.0378), which indicates that the updated model can accurately forecast the concentration of surface corrosion factors and the diffusion coefficient of corrosion factors. In addition, BP requires 13 iterations to achieve convergence, whereas the SSA-BP model only requires 9 iterations, indicating a significant improvement in the convergence speed of the SSA-BP model. The model was trained and simulated 20 times to compare the robustness of the SSA-BP model with the BP model, and the results are shown in Figure 9. The coefficient of variation of the SSA-BP model was found to be between 5% and 18%, whereas the coefficient of variation of the BP model was between 7% and 35%.

**Figure 5.** Prediction results of the SSA-BP model.

**Figure 6.** Prediction results of the BP model.

**Figure 7.** Convergence process of the BP model.

**Figure 8.** Convergence process of the SSA-BP model.

**Figure 9.** Analysis results of robustness of the SSA-BP and BP model.

#### **4. Analysis of Parameter Sensitivity**

The SSA-BP neural network model was used to calculate the weights between the input and hidden layer to analyze the impact of various parameters on the diffusion coefficient D of corrosion factors and the concentration Cs of surface corrosion factors. The results are shown in Tables 2 and 3, respectively.


**Table 2.** Results of connection weights for the input and hidden layer.

**Table 3.** Weight values of the hidden and output layer.


The Garson formula was used to calculate the significant impacts of input parameters on the transfer coefficient of corrosion factors and the concentration of surface corrosion factors, as indicated in the following equation:

$$Z\_{ik} = \frac{\sum\_{j=1}^{L} \left( \frac{\mathbf{w}\_{ij}}{\sum\_{r=1}^{N} w\_{rj}} \mathbf{w}\_{jk} \right)}{\sum\_{j=1}^{N} \left( \sum\_{j=1}^{L} \left( \frac{\mathbf{w}\_{ij}}{\sum\_{r=1}^{N} w\_{rj}} \mathbf{w}\_{jk} \right) \right)} \tag{9}$$

where *wrj* is the connection weight value between the input neuron and the hidden layer neuron *j*, and *vjk* is the connection weight value between the hidden layer neuron j and the output neuron *K*.

The impact of input parameters on the concentration of surface corrosion factors and diffusion coefficient of corrosion factors can be obtained using the steps above based on the connection weights value and biases between the input, hidden, and output layers. The results are shown in Figure 10.

**Figure 10.** Weight analysis results of each input parameter on the corrosion factor of cable. (**a**) Concentration of surface corrosion factors; (**b**) Transfer coefficient of corrosion factors.

Figure 10 depicts the impact of various parameters on the concentration of surface corrosion factors and the transfer coefficient of corrosion factors. The results demonstrate that the dip angle and the defect area of the cable have the most significant effect on both, with weight values all greater than 0.25. Although environmental temperature, humidity, and corrosion time all impact the diffusion rate of corrosion factors, their weight values are all within 0.2. According to the results of the weight analysis of the SSA-BP neural network model, the concentration of surface corrosion factors and diffusion coefficient of corrosion factors of the cable above the defect location (A1 segment cable) and the cable below the defect location (B1 segment cable) were fitted using the tilt angle of cables by the distinguishing criterion, and were based on multiple nonlinear regression criteria. The fitting equation for the concentration of surface corrosion factors and the diffusion coefficient of corrosion factors on the A1 segment cable is shown in the following equation:

$$\begin{cases} \mathbf{C}\_{s} = \boldsymbol{\mu} \cdot \left( t \right)^{A\_{1}} \cdot \left( h \right)^{A\_{2}} \cdot \left( T\_{1} \right)^{A\_{3}} \left( W \right)^{A\_{4}} \cdot \left( \cos \theta \right)^{A\_{5}} + H\\ D = \left[ \boldsymbol{\beta} \cdot \left( t \right)^{B\_{1}} \cdot \left( h \right)^{B\_{2}} \cdot \left( T\_{1} \right)^{B\_{3}} \left( W \right)^{B\_{4}} \cdot \left( \cos \theta \right)^{B\_{5}} + Q \right] \times 10^{-10} \right\} \end{cases} \tag{10}$$

Referring to Equation (10), according to the difference between the concentration of surface corrosion factors and the diffusion coefficient of corrosion factors on the A1 and B1 cable sections, the concentration of surface corrosion factors and the diffusion coefficient of corrosion factors on the B1 cable section can be expressed as the following equation:

$$\begin{cases} \mathbf{C}\_{s} = \eta\_{1} \left[ a \cdot (t)^{A\_{1}} \cdot (h)^{A\_{2}} \cdot (T\_{1})^{A\_{3}} (\mathcal{W})^{A\_{4}} \cdot (\cos \theta)^{A\_{5}} + H \right] \\\ D = \eta \left[ \mathcal{S} \cdot (t)^{B\_{1}} \cdot (h)^{B\_{2}} \cdot (T\_{1})^{B\_{3}} (\mathcal{W})^{B\_{4}} \cdot (\cos \theta)^{B\_{5}} + Q \right] \times 10^{-10} \end{cases} \tag{11}$$

where *t* is the corrosion time of the cable, *h* is the relative humidity of the environment, *T*<sup>1</sup> is the ambient temperature, *W* is the defect size area, *θ* is the dip angle of the cable, and *A*1–*A*5, *B*1–*B*5, *H* and *Q* are undetermined parameters.

MATLAB software programming was used to calculate Equation (10) and bring the known parameters into Equation (10) based on the nonlinear regression function to calculate the concentration of surface corrosion factors and diffusion coefficient of corrosion factors on the cable under different working conditions. The expression of the concentration of surface corrosion factors and the diffusion coefficient of corrosion factors on the A1 segment cable is as follows:

$$\begin{array}{l} \text{C}\_{s} = 0.387 \cdot \text{( $t$ )}^{0.32} \cdot \text{( $h$ )}^{0.08} \cdot \text{( $T\_1$ )}^{0.12} \text{( $W$ )}^{0.52} \cdot \text{( $\cos\theta$ )}^{0.43} + 0.216\\ D = \left[11.42 \cdot \text{( $t$ )}^{0.23} \cdot \text{( $h$ )}^{0.05} \cdot \text{( $T\_1$ )}^{0.11} \text{( $W$ )}^{0.54} \cdot \text{( $\cos\theta$ )}^{0.41} + 1.231\right] \times 10^{-10} \end{array} \tag{12}$$

The diffusion rate of corrosion factors differs between the A1 and B1 segment cables due to the inclination of the cable. The diffusion rate is faster in the B1 section of the cable but slower in the A1 section. According to Equation (12), the expression of the concentration of surface corrosion factors and the diffusion coefficient of corrosion factors on the B1 segment cable is as follows:

$$\begin{array}{l} \mathbf{C}\_{s} = \eta\_{1} \Big[ 0.387 \cdot \left( t \right)^{0.32} \cdot \left( h \right)^{0.08} \cdot \left( T\_{1} \right)^{0.12} \left( W \right)^{0.52} \cdot \left( \cos \theta \right)^{0.43} + 0.216 \Big] \\ D = \eta \Big[ 11.42 \cdot \left( t \right)^{0.23} \cdot \left( h \right)^{0.05} \cdot \left( T\_{1} \right)^{0.11} \left( W \right)^{0.54} \cdot \left( \cos \theta \right)^{0.41} + 1.231 \Big] \times 10^{-10} \ \end{array} \tag{13}$$

The values of *η*<sup>1</sup> and *η* under different tilt angles based on the differences in the concentrations of corrosion factors between different layers inside the A1 and B1 cable segments are shown in Table 4.


**Table 4.** The range of values of *η*<sup>1</sup> and *η* under different tilt angles.

Table 4 shows that when the inclination of the cable increases, the concentration of surface corrosion factors on the B1 cable section gradually decreases compared to the A1 cable section. However, the diffusion coefficient of corrosion factors follows the reverse law, with the diffusion coefficient of corrosion factors on the B1 cable segment being significantly greater than that on the A1 cable section, which indicates that the diffusion rate of corrosion factors downward along the cable's inclination angle is more significant than that upward along the cable's inclination angle. This phenomenon is caused by the following: as the cable's inclination increases, substances such as water, corrosion factors, and oxygen travel lower along the cable, and the corrosion factors continually penetrate from the surface to the interior. As a result, the concentration of surface corrosion factors in section B1 is low, and the diffusion coefficient of corrosion factors is large. The gravity effect will obstruct the upward diffusion of corrosion factors and other substances along the A1 cable segment, resulting in the aggregation of corrosion factors on the cable surface and a decrease in the diffusion coefficient of corrosion factors.

The above depicts the process of solving the concentration of surface corrosion factors and diffusion coefficient of corrosion factors on square-hole defect cable. The diffusion form of corrosion factors in the annular hole cable is studied using the analysis method described above. The spatial diffusion model of corrosion factors in the annular hole defect cable is built to obtain the expression of the concentration of surface corrosion factors and the diffusion coefficient of corrosion factors. It can still be separated into two segments for convenience of representation: the C1 segment above the defect location and the D1 segment below the defect location. The expression is as follows.

(1) The expression of concentration of surface corrosion factors and diffusion coefficient of corrosion factors in the C1 cable segment:

$$\begin{cases} \mathbf{C}\_{s} = 0.393 \cdot \left( t \right)^{0.24} \cdot \left( h \right)^{0.12} \cdot \left( T\_{1} \right)^{0.16} \left( W \right)^{0.57} \cdot \left( \cos \theta \right)^{0.46} + 0.413\\ D = \left[ 13.32 \cdot \left( t \right)^{0.26} \cdot \left( h \right)^{0.06} \cdot \left( T\_{1} \right)^{0.13} \left( W \right)^{0.63} \cdot \left( \cos \theta \right)^{0.47} + 1.572 \right] \times 10^{-10} \right\} \end{cases} \tag{14}$$

According to the expression method of the concentration of surface corrosion factors and diffusion coefficient of corrosion factors on the C1 cable section, the concentration of surface corrosion factors and diffusion coefficient of corrosion factors on the D1 cable section can be expressed as follows.

$$\begin{cases} \mathbf{C}\_{s} = \eta\_{2} \Big[ 0.393 \cdot (t)^{0.24} \cdot (h)^{0.12} \cdot (T\_{1})^{0.16} (\mathcal{W})^{0.57} \cdot (\cos \theta)^{0.46} + 0.413 \Big] \\ D = \eta\_{3} \Big[ 13.32 \cdot (t)^{0.26} \cdot (h)^{0.06} \cdot (T\_{1})^{0.13} (\mathcal{W})^{0.63} \cdot (\cos \theta)^{0.47} + 1.572 \Big] \times 10^{-10} \end{cases} \tag{15}$$

Table 5 shows the values of *η*<sup>2</sup> and *η*<sup>3</sup> at different tilt angles. The amplification coefficients of the concentration of surface corrosion factors and diffusion coefficients of corrosion factors on the D1 segment cable under tilt angles are shown in Table 5. Compared with the results shown in Table 4, the tilt angle has a more significant impact on the concentration of surface corrosion factors and diffusion coefficient of corrosion factors on the ring defect cable.


**Table 5.** The range of values of *η*<sup>2</sup> and *η*<sup>3</sup> under different tilt angles.
