A method and device for predicting a pipeline corrosion rate based on an IPSO-BP neural network model, an electronic device, and a storage medium

By constructing an IPSO-BP neural network model and optimizing the BP neural network using an improved particle swarm optimization algorithm, the problem of accuracy in predicting pipeline corrosion rates was solved, achieving faster convergence and higher prediction accuracy, thus supporting corrosion control and equipment maintenance.

CN122333936APending Publication Date: 2026-07-03CHINA NAT PETROLEUM CORP +1
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2026-07-03

AI Technical Summary

Technical Problem

Existing technologies struggle to accurately predict pipeline corrosion rates, especially in multi-factor, high-dimensional problems. The limitations of traditional optimization algorithms and neural network models lead to poor prediction results.

Method used

An improved particle swarm optimization algorithm (IPSO) is used to optimize the BP neural network, and an IPSO-BP neural network model is constructed. By adjusting the inertia weight factor, individual experience learning factor and social experience learning factor, the global search and local search are balanced, thereby improving the convergence and search capability of the model.

Benefits of technology

The IPSO-BP neural network model can converge faster, improve prediction accuracy, and achieve accurate prediction of pipeline corrosion rates, helping to develop maintenance plans, extend equipment life, and reduce maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122333936A_ABST
    Figure CN122333936A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of pipeline corrosion, and particularly relates to a method and device for predicting pipeline corrosion rate based on an IPSO-BP neural network model, an electronic device and a storage medium. The IPSO-BP neural network model is a hybrid algorithm. The IPSO algorithm adjusts the inertia weight factor, individual experience learning factor and social experience learning factor in the PSO algorithm in a nonlinear decreasing manner, so that the PSO algorithm can balance the relationship between global search and local search in the search process, thereby improving the convergence and search ability of the PSO algorithm, and better optimizing the BP neural network model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of pipeline corrosion technology, and in particular to a method, apparatus, electronic device, and storage medium for predicting pipeline corrosion rate based on an IPSO-BP neural network model. Background Technology

[0002] In the pipeline construction and petroleum refining industries, accurate prediction and measurement of internal pipeline corrosion are of great significance for pipeline maintenance and management.

[0003] Currently, scholars both domestically and internationally have conducted extensive research on corrosion rate prediction and proposed numerous prediction models. For example, Sobhan et al. introduced the Raven Search algorithm to optimize the penalty and kernel parameters of the least squares support vector machine, constructing the CSA-LSS-VM pipeline corrosion rate model. Liang et al. introduced a genetic algorithm to optimize the weights and thresholds of the BP neural network, constructing the GA-BPNN corrosion rate model. However, all of these models are limited by the optimization algorithms and the inherent limitations of the neural networks themselves, which may lead to the inability to accurately predict pipeline corrosion rates for multi-factor, high-dimensional problems. Summary of the Invention

[0004] The purpose of this invention is to provide a method, apparatus, electronic device, and storage medium for predicting pipeline corrosion rate based on the IPSO-BP neural network model, in order to solve the above-mentioned technical problems.

[0005] To achieve the above objectives, this invention provides a method for predicting pipeline corrosion rates based on an IPSO-BP neural network model, comprising:

[0006] Construct a BP neural network;

[0007] The IPSO algorithm is used to optimize the BP neural network, resulting in the IPSO-BP neural network model.

[0008] Predicting pipeline corrosion rates using the IPSO-BP neural network model.

[0009] This invention also provides a device for predicting pipeline corrosion rates based on an IPSO-BP neural network model, comprising:

[0010] Building blocks, used to construct BP neural networks;

[0011] The unit is used to optimize the BP neural network using the IPSO algorithm to obtain the IPSO-BP neural network model.

[0012] The prediction unit is used to predict pipeline corrosion rates using the IPSO-BP neural network model.

[0013] The present invention also provides an electronic device, comprising: a processor coupled to a memory;

[0014] The processor is configured to read and execute a computer program stored in the memory to implement the method described in any of the preceding embodiments.

[0015] The present invention also provides a computer-readable storage medium storing a program or instructions that, when executed by a processor, implement the method as described in any of the preceding claims.

[0016] The technical effects and advantages of this invention are as follows:

[0017] 1. IPSO (Improved Particle Swarm Optimization) is an improvement and optimization of the traditional PSO (Particle Swarm Optimization) algorithm. The traditional PSO algorithm uses a linear acceleration factor to adjust the speed, while the IPSO algorithm introduces a nonlinear acceleration factor. By gradually reducing the range of the acceleration factor, the particles can explore the global optimum faster in the early stage of the search, and converge to the local optimum more accurately in the later stage of the search. This makes the BP neural network model converge faster and more accurately.

[0018] 2. The IPSO-BP neural network model is a hybrid algorithm. The IPSO algorithm adjusts the inertia weight factor, individual experience learning factor, and social experience learning factor in the PSO algorithm in a non-linear decreasing manner. This allows the IPSO algorithm to balance the relationship between global search and local search during the search process, thereby improving the convergence and search capability of the IPSO algorithm and thus better optimizing the BP neural network model.

[0019] 3. Corrosion is a common problem in many industrial equipment and structures. Accurately predicting corrosion rates can help with corrosion control and protection design. By predicting corrosion rates, appropriate material selection, coating protection, and anti-corrosion measures can be determined, extending the service life of equipment and structures.

[0020] 4. Corrosion can lead to the degradation and damage of equipment or structures, affecting their performance and safety. Accurately predicting corrosion rates can help develop maintenance plans, including regularly inspecting, repairing, or replacing corroded components to prevent equipment failures and accidents. Furthermore, based on the prediction results, maintenance strategies can be optimized to reduce maintenance costs and downtime.

[0021] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. Attached Figure Description

[0022] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a flowchart of a method for predicting pipeline corrosion rate based on the IPSO-BP neural network model.

[0024] Figure 2 A comparison chart of the PSO and IPSO algorithms;

[0025] Figure 3 A comparison chart of corrosion rates predicted by different schemes;

[0026] Figure 4 A comparison chart of various evaluation indicators for different schemes. Detailed Implementation

[0027] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0028] It should be noted that the structures, proportions, sizes, etc., illustrated in the accompanying drawings are merely for illustrative purposes to aid those skilled in the art and to facilitate understanding and reading. They are not intended to limit the scope of the invention and therefore have no substantial technical significance. Any modifications to the structure, changes in proportions, or adjustments to size, without affecting the effectiveness and purpose of the invention, should still fall within the scope of the technical content disclosed herein. Furthermore, the terms "upper," "lower," "left," "right," "middle," and "one" used in this specification are merely for clarity and not intended to limit the scope of the invention. Changes or adjustments to their relative relationships, without substantially altering the technical content, should also be considered within the scope of the invention.

[0029] To address the shortcomings of existing technologies, this invention discloses a method for predicting pipeline corrosion rates based on an IPSO-BP neural network model, comprising:

[0030] 1. Construct a BP neural network.

[0031] Specifically, this includes: obtaining a dataset containing pipeline corrosion characteristics and corrosion rates; determining the number of input layer nodes, output layer nodes, hidden layers, and hidden layer nodes of the BP neural network based on the dataset; and constructing the BP neural network based on the number of input layer nodes, output layer nodes, hidden layers, and hidden layer nodes.

[0032] The corrosion characteristics include at least one of the following: temperature, pH value, oxygen content, CO2 content, sulfur content, nitrogen content, operating pressure, and flow rate.

[0033] It should also be noted that, in order to ensure data quality and consistency, the data in the dataset needs to be cleaned, processed, and standardized.

[0034] 2. Optimize the BP neural network using the IPSO algorithm to obtain the IPSO-BP neural network model.

[0035] Specifically, the process includes: normalizing the dataset and dividing it into training and testing datasets; initializing the IPSO algorithm parameters and calculating the global fitness by updating particle velocity and position iteratively; ending the iteration when the error between the current global fitness and the previous global fitness meets the requirements, and using the current particle position and current global fitness as the global optimal position and global optimal fitness; obtaining the optimal weights and thresholds of the BP neural network based on the global optimal position and global optimal fitness of the IPSO algorithm; and determining the IPSO-BP neural network model based on the optimal weights and thresholds of the BP neural network.

[0036] The initialization of the IPSO algorithm parameters includes the number of particles, particle velocity, and particle position. The particle position is generally represented by a position vector x, meaning that each particle corresponds to a position vector x. The position vector x of each particle corresponds to a set of weights and thresholds in the BP neural network.

[0037] In this algorithm, the fitness function serves as a bridge between the IPSO algorithm and the BP neural network. The dependent variable is the error calculated by the BP neural network, while the independent variables are the number of particles, particle velocities, and particle positions in the IPSO algorithm. Specifically, since the IPSO algorithm essentially involves changes in particle positions, the fitness function is the objective function for the current particle and also the error function of the BP neural network. As the fitness function iterates, the error generated by the BP neural network's error function gradually decreases, and the particle position vectors within the IPSO optimization algorithm continuously change. Each particle continuously updates its optimal position during the search (iteration) process, resulting in a global optimal solution for the entire particle swarm—the position of the particle with the best fitness. This position represents the optimal solution that all particles can find, and thus represents the optimal weights and thresholds of the BP neural network.

[0038] Specifically, the particle velocity and particle position are updated iteratively using the following formula:

[0039]

[0040] Where v is velocity; x is position; t is iteration number; ω is inertia weight factor; i is particle number; d is dimension index; c1 is individual experience learning factor; c2 is social experience learning factor; r1 and r2 are pseudo-random numbers uniformly distributed in [0, 1]; p id This represents the optimal position of the particle itself; p gd This refers to the optimal position of all particles in the global search space.

[0041] Specifically, the inertia weighting factor, individual experience learning factor, and social experience learning factor are obtained using the following linearly decreasing formula:

[0042] w=(w_init-w_final)*(MaxNum-k) / MaxNum+w_final

[0043] c1=(c1_init-c1_final)*(MaxNum-k) / MaxNum+c1_final

[0044] c2=(c2_init-c2_final)*(MaxNum-k) / MaxNum+c2_final

[0045] Where w_init, c1_init, and c2_init are the initial values; w_final, c1_final, and c2_final are the final values; MaxNum is the maximum number of iterations, and k is the current number of iterations.

[0046] In the IPSO-BP neural network model, adjusting the inertia weight factor, individual experience learning factor, and social experience learning factor in a linearly decreasing manner is to improve the algorithm's convergence and search capability. Specifically:

[0047] Regarding the inertia weight factor: Initially, the inertia weight is set to a large value to facilitate global search. As the number of iterations increases, the inertia weight is gradually decreased, causing the individual's search focus to gradually shift from global search to local search, thereby improving the algorithm's convergence and stability.

[0048] The IPSO algorithm considers both individual and social experience learning factors. Initially, the individual experience learning factor is set to a large value to promote global search and exploration. As the number of iterations increases, the individual experience learning factor is gradually decreased, weakening its influence on both individual and social experience learning factors to enhance individual adaptability and local search capabilities. Therefore, by adjusting the inertia weight factor, individual experience learning factor, and social experience learning factor in a linearly decreasing manner, the IPSO algorithm can balance the relationship between global and local search during the search process, thereby improving its convergence and search capability and ultimately better optimizing the neural network model.

[0049] 3. Predict pipeline corrosion rate using the IPSO-BP neural network model.

[0050] Specifically, this includes: substituting corrosion feature data from the test dataset into the IPSO-BP neural network model to obtain the predicted corrosion rate; and evaluating the accuracy and stability of the IPSO-BP neural network model by the error between the predicted corrosion rate and the actual corrosion rate corresponding to the corrosion feature data.

[0051] The error calculation includes at least one of the following: mean absolute error, root mean square error, and coefficient of determination, as shown in the following formulas:

[0052]

[0053] R 2 =1-(SSE / SST)

[0054] Where MAPE represents the mean absolute error; RMSE represents the root mean square error; R 2 The coefficient of determination is represented by SSE; SSE represents the sum of squares of the differences between the predicted corrosion rate and the actual corrosion rate for each data point, while SST is the sum of squares of the differences between the actual predicted corrosion rate and the mean for each data point; n represents the total number of data points; y i This represents the actual corrosion rate of the i-th data point; This represents the predicted corrosion rate for the i-th data point.

[0055] It should also be noted that the validated IPSO-BP neural network model can be applied to real-world scenarios to predict corrosion rates in real time. For example, a user-friendly interface can be developed where relevant corrosion feature data is input, and the predicted corrosion rate result can be directly output. Furthermore, to maintain the accuracy and adaptability of the IPSO-BP neural network model, it can be periodically trained and updated based on new data.

[0056] To better understand this solution, the following embodiments are also provided.

[0057] A method for predicting corrosion rates in natural gas and oil pipelines based on an IPSO-BP neural network model, such as... Figure 1 As shown, it includes:

[0058] 1. Selection of structural parameters for BP neural networks.

[0059] This invention employs a basic 3-layer network structure, with only 1 hidden layer to avoid overfitting. The number of input and output layer nodes is determined by the pipeline data used in this invention, such as temperature (°C), pH value, and oxygen content (mg·kg) in the pipeline data. -1 CO2 content / % and sulfur content / mg·kg -1 Nitrogen content / mg·kg -1 Operating pressure / MPa, flow rate / m·s -1 This can be viewed as the input layer of a BP neural network, and the corrosion rate of the pipeline can be considered as the output layer. That is, the input layer has 8 nodes and the output layer has 1 node.

[0060] The number of hidden layer nodes is determined by an empirical formula. Let z be defined as follows: p and q represent the number of nodes in the input and output layers, respectively, and a is a constant in the range (1, 10). In this paper, p = 8 and q = 1, so the range of z is [4, 13]. Experiments were conducted with different numbers of hidden layer nodes. When the number of hidden layer nodes was chosen to be 11, the root mean square error was smaller, so the number of hidden layer nodes was chosen to be 11.

[0061] 2. Based on the corrosion characteristics and corrosion rate in step 1, 180 sets of natural gas pipeline operation data were randomly selected. 80% of the data were selected as the training set to train the model, and the remaining 20% ​​were selected as the test set to verify the model.

[0062] To reduce computational inconvenience and excessive errors caused by different data units, pipeline data must be normalized at the beginning, ensuring that the normalized data size falls within the range [0,1]. The normalization formula is as follows:

[0063]

[0064] Among them, y ax y represents the maximum target value in the original data. ain x is the minimum target value in the original data. ax x is the largest eigenvalue in the original data. ain Let x be the smallest eigenvalue in the original data, α be the normalized eigenvalue, and x be the smallest eigenvalue in the original data. i These are the eigenvalues ​​before normalization.

[0065] It should also be noted that the activation function used in this BP neural network is the common sigmoid function. The training iterations are set to 5000, the learning rate to 0.01, and the training target to 10. -5 .

[0066] 3. Similar to the PSO-BP neural network model, the IPSO-BP neural network model essentially optimizes the initial weights and thresholds of the BP neural network to achieve better sample prediction.

[0067] Among them, the particle swarm optimization algorithm simulates the changes in the position and velocity of particles in space. With the fusion of evolutionary information from individual learning and social learning, through continuous iteration, particles adjust their velocity and position according to their own state and environment, gradually approaching the optimal position, thereby achieving the global optimal solution.

[0068] The following is the process of optimizing a BP neural network using the IPSO algorithm:

[0069] 3.1 By feeding the data from the training set into the BP neural network, the initial weights and thresholds of the BP neural network can be obtained. Then, the IPSO algorithm is initialized, such as setting the allowable error to 0.01, the maximum number of iterations allowed per particle to 50, the particle swarm size to 10, the initial individual experience learning factor to 2, the initial social experience learning factor to 2, the initial inertia factor to 0.6, and the maximum particle flight speed to 0.8.

[0070] 3.2 Calculate the fitness value of each particle according to the fitness function, and save the optimal position of each particle and the best fitness value and the best position of the population for all particles.

[0071] The speed and position are updated according to the following formula:

[0072]

[0073] In the improved IPSO optimization algorithm, we adopt the following linear decreasing approach for the inertia weight factor (ω), individual experience learning factor (c1), and social experience learning factor (c2):

[0074] w=(w_init-w_final)*(MaxNum-k) / MaxNum+w_final

[0075] c1=(c1_init-c1_final)*(MaxNum-k) / MaxNum+c1_final

[0076] c2=(c2_init-c2_final)*(MaxNum-k) / MaxNum+c2_final

[0077] Where w_init, c1_init, and c2_init are the initial values, w_final, c1_final, and c2_final are the final values, MaxNum is the maximum number of iterations, and k is the current iteration number. This transformation allows the particle to focus more on global search in the initial stage, gradually shifting to local search as the number of iterations increases, thus improving the convergence speed and search performance of the IPSO optimization algorithm.

[0078] 3.3 Calculate the updated fitness value of each particle. Compare the best fitness value of each particle with its fitness value at its historical best position. If better, take its current position as the particle's best position. For each particle, compare the fitness value corresponding to its best position with the population's best fitness value. If better, update the population's best position and best fitness value. Determine if the search results meet the stopping condition (reaching the maximum number of generations or meeting the accuracy requirement). Finally, the optimal weights and thresholds of the BP neural network correspond to the population's best position, thus obtaining the IPSO-BP neural network model.

[0079] Comparing the PSO-BP neural network model and the IPSO-BP neural network model, it was found that the IPSO-BP neural network model has a faster iteration speed and higher convergence accuracy, such as... Figure 2 As shown.

[0080] 4. Verify the superiority and accuracy of the IPSO-BP neural network model.

[0081] The accuracy of the IPSO-BP neural network model was verified using test set data. The calculation error was verified multiple times. Under the same data, the predicted corrosion rates of the ordinary PSO-BP neural network model, GA-BP neural network, and BP neural network were compared with the original corrosion rate data. The results are as follows: Figure 3 As shown, it is clear that the IPSO-BP neural network model has the best prediction performance.

[0082] Preferably, the present invention can also compare the accuracy of each model using three error indices.

[0083] The formula for calculating Mean Absolute Error (MAPE) is as follows:

[0084]

[0085] The formula for calculating the root mean square error (RMSE) is as follows:

[0086]

[0087] Coefficient of determination R 2The calculation formula is as follows.

[0088] R 2 =1-(SSE / SST)

[0089] Where SSE is the sum of squares of the differences between the predicted value and the actual observed value for each data point, and SST is the sum of squares of the differences between the actual observed value and the data mean for each data point.

[0090] Error results passed Figure 4 It can be seen that all three metrics of the IPSO-BP neural network model are optimal, indicating that the IPSO-BP neural network model has high accuracy in predicting data.

[0091] This invention also provides a device for predicting pipeline corrosion rates based on an IPSO-BP neural network model, comprising:

[0092] Building blocks, used to construct BP neural networks;

[0093] The unit is used to optimize the BP neural network using the IPSO algorithm to obtain the IPSO-BP neural network model.

[0094] The prediction unit is used to predict pipeline corrosion rates using the IPSO-BP neural network model.

[0095] Since the protection provided by this device is similar to that provided by the method described above, it will not be described in detail here. Please refer to the discussion section of the method described above for more information.

[0096] The present invention also provides a device. This electronic device includes: at least one processor, at least one communication interface, at least one memory, and at least one communication bus; optionally, the communication interface can be an interface of a communication module, such as an interface of a GSM module; the processor may be a CPU, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention. The memory may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device. The memory stores a program, and the processor calls the program stored in the memory to execute the methods provided in the above embodiments of this application.

[0097] Corresponding to the methods described above in this application, this application also provides a computer storage medium. The computer storage medium stores a computer program, which is executed by a processor to perform the methods provided in the above embodiments of this application.

[0098] Finally, it should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for predicting a pipeline corrosion rate based on an IPSO-BP neural network model, the method comprising: include: Construct a BP neural network; The IPSO algorithm is used to optimize the BP neural network, resulting in the IPSO-BP neural network model. Predicting pipeline corrosion rates using the IPSO-BP neural network model.

2. The method of claim 1, wherein, Constructing a BP neural network includes: Obtain a dataset containing pipeline corrosion characteristics and corrosion rates; Based on the dataset, determine the number of input layer nodes, output layer nodes, hidden layer nodes, and hidden layer nodes of the BP neural network; Construct a BP neural network based on the number of input layer nodes, output layer nodes, hidden layer nodes, and hidden layer nodes; The corrosion characteristics include at least one of the following: temperature, pH value, oxygen content, CO2 content, sulfur content, nitrogen content, operating pressure, and flow rate.

3. The method of claim 2, wherein, The IPSO algorithm is used to optimize the BP neural network, resulting in the IPSO-BP neural network model, which includes: The dataset is normalized and divided into training and testing datasets. The parameters of the IPSO algorithm are initialized, and the global optimal position and global optimal fitness of the IPSO algorithm are obtained iteratively using the fitness function based on the training dataset. Based on the global optimal position and global optimal fitness of the IPSO algorithm, the optimal weights and thresholds of the BP neural network are obtained. Based on the optimal weights and thresholds of the BP neural network, the IPSO-BP neural network model is determined. The dependent variable of the fitness function is the error calculated by the BP neural network, and the independent variables are the number of particles, particle velocity, and particle position in the IPSO algorithm.

4. The method of claim 3, wherein, The global optimal position and global optimal fitness of the IPSO algorithm are obtained through fitness function iteration, including: Global fitness is calculated by updating and iterating particle velocity and particle position; The iteration ends when the error between the current global fitness and the previous global fitness meets the requirements, and the current particle position and the current global fitness are taken as the global optimal position and the global optimal fitness.

5. The method of claim 4, wherein, The particle velocity and position are updated iteratively using the following formula: where v is velocity; x is position; t is iteration number; ω is inertia weight factor; i is example number; d is dimension index; c1 is individual experience learning factor; c2 is social experience learning factor; r1 and r2 are pseudo-random numbers uniformly distributed in [0, 1]; p id represents the best position of a particle itself; p gd refers to the best position of all particles currently in the global search space.

6. The method of claim 5, wherein, The inertia weighting factor, individual experience learning factor, and social experience learning factor are obtained using the following linearly decreasing formula: w=(w_init-w_final)*(MaxNum-k) / MaxNum+w_final c1=(c1_init-c1_final)*(MaxNum-k) / MaxNum+c1_final c2=(c2_init-c2_final)*(MaxNum-k) / MaxNum+c2_final Where w_init, c1_init, and c2_init are the initial values ​​of the inertia weight, individual experience learning factor, and social experience learning factor, respectively; w_final, c1_final, and c2_final are the final values ​​of the inertia weight, individual experience learning factor, and social experience learning factor, respectively; MaxNum is the maximum number of iterations; and k is the current number of iterations.

7. The method of claim 3, wherein, The method further includes: After substituting the corrosion feature data from the test dataset into the IPSO-BP neural network model, the predicted corrosion rate is obtained. The accuracy of the IPSO-BP neural network model is evaluated by comparing the error between the predicted corrosion rate and the actual corrosion rate corresponding to the corrosion feature data in the test dataset.

8. The method of claim 7, wherein, Error calculation includes at least one of the following: mean absolute error, root mean square error, and coefficient of determination, as shown in the following formulas: R 2 = 1 - (SSE / SST) Where MAPE represents the mean absolute error; RMSE represents the root mean square error; R 2 The coefficient of determination is represented by SSE; SSE represents the sum of squares of the differences between the predicted corrosion rate and the actual corrosion rate for each data point, while SST is the sum of squares of the differences between the actual predicted corrosion rate and the mean for each data point; n represents the total number of data points; y i This represents the actual corrosion rate of the i-th data point; This represents the predicted corrosion rate for the i-th data point.

9. A device for predicting pipeline corrosion rate based on an IPSO-BP neural network model, characterized in that, include: Building blocks, used to construct BP neural networks; The unit is used to optimize the BP neural network using the IPSO algorithm to obtain the IPSO-BP neural network model. The prediction unit is used to predict pipeline corrosion rates using the IPSO-BP neural network model.

10. An electronic device, characterized in that, include: Processor, the processor being coupled to memory; The processor is configured to read and execute a computer program stored in the memory to implement the method as described in any one of claims 1-8.

11. A computer-readable storage medium storing a program or instructions, characterized in that, When the program or instructions are executed by the processor, they implement the method as described in any one of claims 1-8.