CN113807598A - SVM heavy oil pipeline corrosion rate prediction method based on PSO-WOA hybrid optimization - Google Patents

SVM heavy oil pipeline corrosion rate prediction method based on PSO-WOA hybrid optimization Download PDF

Info

Publication number
CN113807598A
CN113807598A CN202111127589.8A CN202111127589A CN113807598A CN 113807598 A CN113807598 A CN 113807598A CN 202111127589 A CN202111127589 A CN 202111127589A CN 113807598 A CN113807598 A CN 113807598A
Authority
CN
China
Prior art keywords
woa
svm
pso
model
oil pipeline
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111127589.8A
Other languages
Chinese (zh)
Inventor
谢飞
苏禹铭
王丹
孙东旭
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Liaoning Shihua University
Shenyang University of Technology
Original Assignee
Liaoning Shihua University
Shenyang University of Technology
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Liaoning Shihua University, Shenyang University of Technology filed Critical Liaoning Shihua University
Priority to CN202111127589.8A priority Critical patent/CN113807598A/en
Publication of CN113807598A publication Critical patent/CN113807598A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/04Forecasting or optimisation specially adapted for administrative or management purposes, e.g. linear programming or "cutting stock problem"
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N20/00Machine learning
    • G06N20/10Machine learning using kernel methods, e.g. support vector machines [SVM]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/004Artificial life, i.e. computing arrangements simulating life
    • G06N3/006Artificial life, i.e. computing arrangements simulating life based on simulated virtual individual or collective life forms, e.g. social simulations or particle swarm optimisation [PSO]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Artificial Intelligence (AREA)
  • Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Human Resources & Organizations (AREA)
  • Computing Systems (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Strategic Management (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Economics (AREA)
  • Mathematical Physics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Game Theory and Decision Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Medical Informatics (AREA)
  • Evolutionary Biology (AREA)
  • Development Economics (AREA)
  • Biophysics (AREA)
  • Molecular Biology (AREA)
  • Biomedical Technology (AREA)
  • Health & Medical Sciences (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention relates to a PSO-WOA hybrid optimization-based SVM thick oil pipeline corrosion rate prediction method, which uses target thick oil pipeline detection data as a data set, optimizes parameters of a Support Vector Machine (SVM) by combining a PSO (particle swarm optimization) -WOA (whale) hybrid optimization algorithm, and an established model is applied to the fields of thick oil pipeline steel corrosion rate prediction and corrosion protection. The method disclosed by the invention combines the advantages of optimal solution searching by PSO and local optimal WOA jumping out, optimizes the model parameters, improves the prediction precision of the model under a limited data set, and provides reliable reference for the operation and maintenance of the heavy oil pipeline.

Description

SVM heavy oil pipeline corrosion rate prediction method based on PSO-WOA hybrid optimization
Technical Field
The invention relates to a PSO (particle swarm) -WOA (whale) hybrid optimization-based thick oil pipeline corrosion rate prediction method based on a Support Vector Machine (SVM), which is applied to the field of corrosion and protection of oil and gas pipelines.
Background
The prediction of the corrosion rate of the buried pipeline is always a hot point of research of scholars at home and abroad, and the prediction of the corrosion rate has great significance on the basic design of the pipeline and the related safety, environmental and economic consequences.
Because various different environmental parameters which can directly influence and predict a pipeline corrosion rate model are quite complex, and the corrosion rate and various related parameters in a medium system are always in a nonlinear relationship with each other, the purpose of predicting the metal corrosion speed by using the established model is possible to be realized under the condition that accurate corrosion rate and related parameter data can be obtained, so that some scholars begin to establish a corrosion rate prediction model by using a neural network. After a neural network prediction model is developed for a period of time, how to improve the prediction performance of the model and better establish the prediction model suitable for pipeline corrosion becomes a technical problem which is always eagerly solved in the field.
Disclosure of Invention
The invention aims to provide a PSO-WOA hybrid optimization-based SVM heavy oil pipeline corrosion rate prediction method, which integrates the advantages of two algorithms, optimizes model parameters and improves the prediction accuracy of the model.
In order to achieve the purpose, the technical scheme of the invention is as follows: a corrosion rate prediction method for an SVM heavy oil pipeline based on PSO-WOA hybrid optimization comprises the following steps:
s1, selecting environment factors which are representative and relevant to corrosion behaviors in the operation process of the thick oil pipeline as input variables;
s2, detecting relevant parameters along the pipeline on site by taking the thick oil pipeline as a research object, and sorting detection data to serve as a model data set;
s3, selecting 22 groups of sample data as training samples, establishing a thick oil pipeline corrosion rate prediction model, using 8 groups of sample data as test samples, and evaluating the optimized model precision;
s4, establishing a corrosion rate prediction model of the SVM heavy oil pipeline based on PSO-WOA hybrid optimization;
and step S5, evaluating the model prediction effect according to the relevant evaluation indexes.
In an embodiment of the present invention, the representative and relevant environmental factors of the corrosion behavior of the thick oil pipeline in step S1 include soil resistivity, water content, and Cl along the pipeline-Content, potential gradient, oxidation-reduction potential, pH value.
In an embodiment of the present invention, in step S4, an SVM is used as a basic neural network model for thick oil pipeline corrosion rate prediction, and the specific implementation steps are as follows:
(1) the basic principle of SVM is through a non-linear mapping function
Figure BDA0003279159230000011
Mapping an input sample x to a high-dimensional feature space F, creating a linear regression function according to the principle of minimizing the structural risk, converting each group of data in a training sample into the high-dimensional space, and performing linear regression on data in the high-dimensional space, so that the nonlinear fitting problem of an original sample is converted into the linear regression problem of the sample in the high-dimensional space, wherein the obtained fitting function is as follows:
y′=f(x)=w·Φ(x)+b (1)
wherein x is the input vector of the sample, w is the weight vector, w belongs to R, b is the deviation vector of the sample, b belongs to R, y' is the predicted value;
when solving the regression fitting problem by SVM, fitting errors are considered and allowed, and a linear insensitive loss function (epsilon) is introduced on the basis of the support vector machine to obtain a regression support vector machine, thus, the regression problem is converted into a solution of an objective function minimizing the structural risk, i.e., values of w and b of the objective function are minimized,
Figure BDA0003279159230000021
whereinC is greater than 0, which is a penalty factor, and controls the penalty degree of each sample to exceed the error epsilon, and relaxation factors ζ i and ζ i' are introduced to reduce the error generated in the training process, wherein the relaxation factors are respectively
Figure BDA0003279159230000026
The upper limit and the lower limit of the sample training error under the condition of (1) represent a degree of deviation of the sample from an outlier or from a boundary, epsilon refers to a parameter of a linear insensitive loss function, and when the absolute error of a predicted value and a measured value is less than epsilon, the absolute error is ignored; otherwise, it will be included in the error;
(2) introducing Lagrange multiplier a when solving equationiAnd biThe Lagrange function is constructed, the function expression of the problem is regarded as a convex quadratic programming problem, so that the parameter partial derivatives can be solved respectively, and the dual is an initial formula
Figure BDA0003279159230000022
Is converted into
Figure BDA0003279159230000023
On the one hand, they are approximate, and on the other hand, w and b can be solved first, and for lambda, lambda has a value if and only if the data falls on two imaginary lines; for other samples, λ does not work, i.e. λ only works on the support vector, the problem solution is simplified; therefore, after the dual problem is converted, convex optimization is simplified into maximization of a quadratic form, and a saddle point of a Lagrangian equation can be solved; determining and setting the partial derivative of each variable to zero; after introducing lagrangian and using dual principle, convert to:
Figure BDA0003279159230000024
(3) when solving the non-linear problem by means of SVM, the input samples x are passed through a non-linear mapping function
Figure BDA0003279159230000027
Is mapped onto a high-dimensional feature space F, and then a linear regression of the high-dimensional feature space is performed, the transformation from the low-dimensional space to the high-dimensional space being by a kernel function
Figure BDA0003279159230000028
The function can not replace dot products in a high-dimensional space, and the use of a nonlinear mapping function is avoided
Figure BDA0003279159230000029
The calculation time and complexity are greatly reduced; the Radial basis function is used, as follows:
Figure BDA0003279159230000025
where g is the width of the kernel function, i.e. the kernel parameter (g > 0), xi-xjIs Euclidean norm, and after introducing kernel parameters, optimization target conversion is as follows:
Figure BDA0003279159230000031
solving the SVM nonlinear regression model function as follows:
Figure BDA0003279159230000032
x1,x2,...,xnis an input variable, ai-biAre network weights and each output vector is a linear transformation of the intermediate node support vector with respect to f (x).
In the step S4, the parameters of the SVM model are optimized by using a PSO-WOA hybrid optimization method, and the specific implementation steps are as follows:
(1) the steps of optimizing the penalty factor C and the kernel parameter g through the PSO algorithm are as follows:
initialization: randomly assigning values to the speed and position of the particles, and learningHabit factor c1And c2Carrying out assignment to obtain a penalty factor C and a kernel parameter g of the SVM;
and (3) fitness evaluation: calculating fitness function values of all particles, and initializing a local optimal value and a global optimal value;
and (3) updating: updating the velocity and position of the particle to obtain a new population, comparing the fitness value with its own historical optimum, and updating the global optimum of the population parameters C and g, the velocity (v) of the particle and its current position (CB) being updated according to equations (7) and (8),
vt+1=wvt+c1r1(Pbestt-CBt)+c2r2(Gbestt-CBt) (7)
CBt+1=CBt+vt (8)
where t denotes the number of iterations, r1And r2Is [0,1 ]]Two random variables of (1), c1And c2Is the learning coefficient, Pbest is the particle optimal position, and Gbest is the particle swarm optimal position;
(2) the specific steps of the WOA optimization algorithm are as follows:
given a random number p ∈ (0,1), if p <0.5 and | A | <1, we randomly find prey, the artificial whale algorithm uses random individual positions in its population for food finding, and updates their spatial positions using the following formula:
Xt+1=Xrand-A·D (9)
t denotes the number of iterations that have been performed, the individual position is denoted by X, and the individual X is randomly selected before the position is updatedrandThe total length of (2) is represented by D ═ C · Xrand-XtI represents that the parameter A is in [ -2,2]Generated randomly, and in addition, random individual XrandEffect on distance of present Individual X Using C as [0,2 ]]Random number representation;
if p <0.5 and | A | is >1, continue to wrap around the prey,
after the artificial whale has searched for food, the spatial location is updated with the following equation:
Xt+1=Xbest-A·|C·Xbest-Xt| (10)
wherein the position of the food corresponds to XbestThe location of the globally optimal individual in the population;
if p is more than or equal to 0.5, carrying out spiral predation;
the characteristics of the motion track of the artificial whale and the logarithmic spiral are consistent, and the artificial whale can swim to the optimal individual XbestIt also updates its spatial location:
Xt+1=Dbest·ebl·cos2πl+Xt (11)
after iterative update with Xt+1X representing whale position, single X before position updatebestLength of (D) ═ Xbest-XtI calculation, constant of spiral track forming is expressed by b, and is in [ -1,1 [)]Assigning a value to l randomly;
substituting the optimized model parameters into an SVM model to calculate an adaptive value, wherein a fitness calculation formula of an objective function when the WOA is combined with the SVM to carry out regression prediction is as follows:
Figure BDA0003279159230000041
where M is the number of samples, yi、yiSetting a WOA optimization target as c and g parameters of an SVM model and taking an obtained optimal solution as an SVM model parameter, wherein the WOA optimization target is a true value and a model prediction value;
(3) a new solution aiming at the organic fusion of the PSO of the WOA in the exploration stage and the development stage;
the initial population is started and updated by the PSO, and then the obtained solution is updated again by the WOA,
vt+1=wvt+c1r1(Whalebestt-CBt)+c2r2(Gbestt-CBt) (13)
as shown in formula (13), the WOA optimization result is fused into a PSO mathematical model formula (7), the particle swarm position is updated according to a new equation, the optimal position of the particle responsible for solving the optimal solution of the complex nonlinear problem is replaced by a while position, the related decision variables are updated, the solution is efficiently guided to the optimal solution, the WOA enables the particle to reach the optimal value more quickly, the calculation time is reduced, and finally, if the determined iteration number is reached, the developed PSO-WOA optimization process is ended.
In an embodiment of the present invention, the penalty factor C obtained after the hybrid optimization is 5.65, and the kernel parameter g is 0.5.
Compared with the prior art, the invention has the following beneficial effects: the hybrid optimization algorithm disclosed by the invention integrates the advantages of the PSO in the development stage and the WOA algorithm in the exploration stage, optimizes the model parameters by using the hybrid optimization algorithm, combines main detection parameters influencing the corrosion rate prediction of the thick oil pipeline, and improves the accuracy of model prediction under the condition of limited field detection data quantity. The number of items to be detected is reduced, and the demand for data acquisition is reduced on the premise of ensuring the prediction precision. A corrosion rate prediction model which is more suitable for the thick oil pipeline and has more excellent prediction performance is established, and effective reference is provided for thick oil pipeline corrosion rate research.
And (3) taking the target thick oil pipeline detection data as a data set, and performing a hybrid optimization SVM pipeline external corrosion rate prediction model of particle swarm optimization and whale optimization algorithm (PSO-WOA). WOA is used in the exploration phase, which is primarily the ability of the algorithm to try a large number of possible solutions because it uses logarithmic spiral paths and therefore covers a large uncertain search space with less computation time. The particle swarm algorithm has the capability of obtaining a near-optimal solution, and is an algorithm for mining an optimal solution from an unknown search space, so that a local optimal solution is provided. And comparing the model performance with the related evaluation indexes of other optimization models to verify the advantages and reliability of the model performance. The method is applied to the thick oil pipeline corrosion rate prediction model, combines the advantages of the PSO and the WOA optimization algorithm, optimizes the parameters of the model, and improves the prediction accuracy of the model.
Drawings
Fig. 1 is a diagram of an SVM neural network.
FIG. 2 is a flow chart of prediction of a PSO-WOA hybrid optimization SVM model.
FIG. 3 is a comparison graph of the predicted results of four model test sets.
FIG. 4 is a comparison graph of the prediction errors of the four model test sets.
Detailed Description
The invention provides a PSO-WOA hybrid optimization-based SVM heavy oil pipeline corrosion rate prediction method, which integrates the advantages of two algorithms, optimizes model parameters and improves the prediction accuracy of the model. The method is realized as follows:
s1, selecting representative and relevant environmental factors of corrosion behavior in the running process of the thick oil pipeline, and taking soil resistivity, water content, C1-content, potential gradient, oxidation-reduction potential and pH value along the pipeline as input variables;
s2, detecting relevant parameters along the pipeline on site by taking the thick oil pipeline as a research object, and sorting detection data to serve as a model data set;
s3, selecting 22 groups of sample data as training samples, establishing a thick oil pipeline corrosion rate prediction model, using 8 groups of sample data as test samples, and evaluating the optimized model precision;
s4, establishing a corrosion rate prediction model of the SVM heavy oil pipeline based on PSO-WOA hybrid optimization;
and step S5, evaluating the model prediction effect according to the relevant evaluation indexes.
In the step S4, the concrete implementation steps of using the SVM as the thick oil pipeline corrosion rate prediction basic neural network model are as follows:
(1) the basic principle of SVM is through a non-linear mapping function
Figure BDA0003279159230000052
The input samples x are mapped onto a high-dimensional feature space F. The linear regression function is created according to the principle of minimizing the structural risk, each group of data in the training sample is transformed into a high-dimensional space, and the data is processed in the high-dimensional spaceAnd (4) performing linear regression, so that the problem of nonlinear fitting of the original sample is converted into the problem of linear regression of the sample in a high-dimensional space. The fitting function obtained is:
y′=f(x)=w·Φ(x)+b (1)
where x is the input vector of samples, w is the weight vector, w ∈ R, b is the bias vector of samples, b ∈ R, y' is the predictor.
When solving the regression fitting problem by SVM, fitting errors are taken into account and allowed. And introducing a linear insensitive loss function (epsilon) on the basis of the support vector machine to obtain a regression support vector machine. Thus, the regression problem is converted into a solution to the objective function that minimizes the risk of the structure, i.e. minimizes the values of w and b of the objective function.
Figure BDA0003279159230000051
Where C > 0, which is a penalty factor. It controls the punishment of each sample to exceed the error epsilon. In order to reduce the error generated in the training process, relaxation factors ζ i and ζ i' are introduced, wherein the relaxation factors are respectively
Figure BDA0003279159230000067
The upper and lower limits of the sample training error under (1) indicate the degree to which the sample deviates from the outlier or from the boundary. ε refers to the parameter of the linear insensitive loss function. When the absolute error between the predicted value and the measured value is less than epsilon, the absolute error is ignored; otherwise, it will be included in the error.
(2) Introducing Lagrange multiplier a when solving equationiAnd biTo construct the lagrangian function. The functional expression of the problem is regarded as a convex quadratic programming problem, so that the parameters can be solved by partial derivatives respectively. Dual is an initial formula
Figure BDA0003279159230000061
Is converted into
Figure BDA0003279159230000062
One is their approximation and the other is such that w, b can be solved first, and for λ, λ has a value if and only if the data falls on the two imaginary lines. For other samples, λ does not work, i.e., λ only works on the support vectors, the problem solution is simplified. Thus after converting it to a dual problem, convex optimization is simplified to a quadratic form of maximization and the saddle points of the lagrange equation can be solved. The partial derivative of each variable is determined and set to zero. After introducing lagrangian and using dual principle, convert to:
Figure BDA0003279159230000063
(3) when solving the non-linear problem by means of SVM, the input samples x are passed through a non-linear mapping function
Figure BDA0003279159230000068
Is mapped onto the high-dimensional feature space F. Then, a linear regression of the high-dimensional feature space is performed. The transformation from the low-dimensional space to the high-dimensional space is performed by a kernel function
Figure BDA0003279159230000069
To be realized. The function can not replace dot products in a high-dimensional space, and the use of a nonlinear mapping function is avoided
Figure BDA00032791592300000610
And greatly reduces the calculation time and complexity. There are four common SVM kernel functions, and the present invention employs a Radial basis function, as follows:
Figure BDA0003279159230000064
where g is the width of the kernel function, i.e. the kernel parameter (g > 0), xi-xjIs the euclidean norm. After nuclear parameters are introduced, optimization targeting is converted into:
Figure BDA0003279159230000065
solving the SVM nonlinear regression model function as follows:
Figure BDA0003279159230000066
the structure diagram of the regression SVM is shown in FIG. 1. In fig. 1, each intermediate node corresponds to a support vector. x is the number of1,x2,...,xnIs an input variable, ai-biAre network weights and each output vector is a linear transformation of the intermediate node support vector with respect to f (x). The kernel function setting of the SVM model has great influence on the prediction result, but the kernel function is selected in no specified setting mode, so the method also comprises the step of using an optimization algorithm to find the parameters and the penalty factors of the optimal kernel function.
The method also comprises the step of optimizing the parameters of the SVM model by using a PSO-WOA mixed optimization method, and the specific implementation steps are as follows:
(1) the particle swarm optimization technology is developed for simulating the behaviors of animals and birds to find a global optimization function, the algorithm can optimize a penalty factor C and a kernel parameter g, and has the characteristics of simple principle, only need of a few calculation parameters, execution of quick search and high efficiency. The algorithm can display the dynamic particle tracking of the current search state and adjust the search strategy to achieve the best search. The steps of optimizing the penalty factor C and the kernel parameter g through the PSO algorithm are as follows:
initialization: randomly assigning the speed and position of the particle and learning factor c1And c2And assigning to obtain a penalty factor C and a kernel parameter g of the SVM.
And (3) fitness evaluation: and calculating the fitness function values of all the particles, and initializing the local optimal value and the global optimal value.
And (3) updating: and updating the speed and the position of the particles to obtain a new population, comparing the fitness value with the historical optimal value of the fitness value, and updating the global optimal values of the population parameters C and g. Essentially, the particle velocity (v) and its current position (CB) are updated according to equations (7) and (8).
vt+1=wvt+c1r1(Pbestt-CBt)+c2r2(Gbestt-CBt) (7)
CBt+1=CBt+vt (8)
Where t denotes the number of iterations, r1And r2Is [0,1 ]]Two random variables of (1), c1And c2Is the learning coefficient, Pbest is the particle optimal position, and Gbest is the particle swarm optimal position.
(2) The WOA algorithm is inspired by unique foraging behavior of the whale of the sitter and is a new meta-heuristic system optimization design algorithm. The location update behavior of the WOA algorithm consists of three phases: in the feeding stage, the feeding mode is to use random individual positions in the population; shrinking the periphery and updating the spatial position; spiral predation, when artificial whales swim to the best individual XbestWhen this happens, it also follows the trajectory of the logarithmic spiral and updates its spatial position again. The specific steps of the WOA optimization algorithm are as follows:
given a random number p ∈ (0,1), if p <0.5 and | A | <1, look for prey randomly. The artificial whale algorithm uses random individual positions in its population for food finding and updates their spatial positions using the following formula:
Xt+1=Xrand-A·D (9)
t denotes the number of iterations that have been performed, the individual position is denoted by X, and the individual X is randomly selected before the position is updatedrandThe total length of (2) is represented by D ═ C · Xrand-XtAnd | represents. Parameter A is [ -2,2]And randomly generating. In addition, random individuals XrandEffect on distance of present Individual X Using C as [0,2 ]]And (4) random number representation.
If p <0.5 and | A | >1, continue to wrap around the prey.
After the artificial whale has searched for food, the spatial location is updated with the following equation:
Xt+1=Xbest-A·|C·Xbest-Xt| (10)
wherein the position of the food corresponds to XbestThe location of the globally optimal individual in the population.
If p is more than or equal to 0.5, spiral predation is carried out.
The characteristics of the motion track of the artificial whale and the logarithmic spiral are consistent, and the artificial whale can swim to the optimal individual XbestIt also updates its spatial location:
Xt+1=Dbest·ebl·cos2πl+Xt (11)
after iterative update with Xt+1X representing whale position, single X before position updatebestLength of (D) ═ Xbest-XtI calculation, constant of spiral track forming is expressed by b, and is in [ -1,1 [)]And assigning a value to the l randomly.
And substituting the optimized model parameters into the SVM model to calculate an adaptive value. The fitness calculation formula of the target function when the WOA is combined with the SVM to carry out regression prediction is as follows:
Figure BDA0003279159230000081
where M is the number of samples, yi、yi' true value and model predicted value. Setting the WOA optimization target as c and g parameters of the SVM model, and taking the obtained optimal solution as SVM model parameters. The whale optimization algorithm has the advantages that the special mechanism that the prey position is randomly selected is benefited, the trouble that the algorithm is trapped in a local optimal solution is avoided, and the target searching capability is further enhanced.
(3) The hybrid optimization algorithm used in the invention is a new solution aiming at organic fusion of the PSOs of the WOA in the exploration stage and the development stage. The particle swarm optimization algorithm is an algorithm for mining an optimal solution from an unknown search space, but is easy to fall into local stagnation, the exploration capability of WOA jumping out of local optimization is strong, the optimal solution and the optimal solution are combined with optimal characteristics (the exploration of WOA and the utilization of PSO), the capability of finding the optimal solution of the problem is improved, and the problem of falling into local stagnation or local optimization is avoided.
Since both algorithms are randomization techniques, we use an uncertain search space from the start to the maximum iteration ceiling during the iteration process. The initial population is started and updated by the PSO and then the obtained solution is updated again by the WOA.
vt+1=wvt+c1r1(Whalebestt-CBt)+c2r2(Gbestt-CBt) (13)
As shown in formula (13), the WOA optimization result is fused into the PSO mathematical model formula (7), and the particle swarm position is updated according to the new formula. The optimal position of the particles responsible for solving the optimal solution of the complex nonlinear problem is replaced by a while position, and related decision variables are updated, so that the solution can be efficiently guided to the optimal solution. WOA brings the particles to the optimum value faster, reducing computation time. Finally, if the determined number of iterations is reached, the developed PSO-WOA optimization process is ended. The model optimization process is shown in flow chart 2.
In an embodiment of the present invention, the penalty factor C obtained after the hybrid optimization is 5.65, and the kernel parameter g is 0.5.
The method comprises the following steps of establishing a PSO-WOA hybrid optimization SVM thick oil pipeline corrosion rate prediction model, establishing GA-SVM, PSO-SVM and WOA-SVM thick oil pipeline corrosion rate prediction models, and comparing prediction effects of various methods, wherein the prediction models comprise:
selecting soil resistivity, water content and Cl-And six environmental factors of content, potential gradient, oxidation-reduction potential and pH value are used as input variables of the thick oil pipeline corrosion rate prediction model. And (3) taking the target thick oil pipeline as a research object, and obtaining 30 groups of detection data through data detected on site. 22 groups of data are selected as training data, and 8 groups of data are selected as test data, and are used for testing the prediction effect of the model and carrying out comparative analysis with other models.
Model training: firstly, a thick oil pipeline corrosion rate prediction model based on PSO-WOA hybrid optimization SVM is established, and meanwhile, a GA-SVM, PSO-SVM and WOA-SVM thick oil pipeline corrosion rate prediction model is established for comparison of prediction effects. The test set output results of the trained model are shown in fig. 3, and the prediction error comparison graph of the test set output results is shown in fig. 4.
And (4) analyzing a prediction result:
and (3) evaluating the prediction performance by using a regression decision coefficient and combining five evaluation indexes of mean square error MSE, mean absolute error MAE, mean absolute percentage error MAPE, root mean square error RMSE, residual square and SSE, wherein the five indexes are respectively positioned as follows:
mean square error MSE:
Figure BDA0003279159230000091
mean absolute error MAE:
Figure BDA0003279159230000092
mean absolute percent error MAPE:
Figure BDA0003279159230000093
root mean square error RMSE:
Figure BDA0003279159230000094
residual sum of squares SSE:
Figure BDA0003279159230000095
where n is the parameter variable value function of the test model in a prediction data unit group in the prediction data set, y isi' true predicted values, y, respectively, of the test model, which are verified by the true predictionsiFor testing model samples to be predictedAnd (5) true prediction value.
According to the evaluation indexes, the comparison of the predicted effect performance of the four models is obtained, and is shown in table 1.
As can be seen from fig. 3, fig. 4 and table 1, the prediction performance of the PSO-WOA hybrid optimization SVM is improved compared with the other three algorithms, the average absolute errors of the GA-SVM, the PSO-SVM, the WOA-SVM and the PSO-WOA-SVM are respectively 0.0251, 0.0155, 0.0114 and 0.0055, the average absolute error of the PSO-WOA-SVM is lower than those of the other three optimization algorithms, and the average absolute percentage errors MAPE are respectively 7.88%, 4.76%, 3.64% and 1.71%, and the RMSE is respectively 0.0289, 0.0174, 0.0131 and 0.0057 by further analyzing other prediction indexes. The prediction index of the PSO-WOA-SVM can be found to be improved in an all-around manner compared with the other three algorithms, and the prediction performance of the PSO-WOA-SVM model is proved to be improved in comparison with the other three algorithms. Compared with the other three models, the method has the advantages that the prediction stability is realized, and the error of corrosion rate prediction in the pipeline operation risk evaluation is reduced.
The matters not described in detail in the present specification belong to the prior art known to those skilled in the art, and the above embodiments are only for illustrating the present invention and not for limiting the present invention. Although the related embodiments of the present invention and the accompanying drawings are disclosed for illustrative purposes, those skilled in the art will appreciate that; various substitutions, changes, modifications and the like are possible without departing from the spirit and scope of the present invention and the appended claims. Therefore, all equivalent technical solutions also belong to the scope of the present invention, and the protection scope of the present invention should be defined by the claims, not limited to the disclosure of the best embodiment and the accompanying drawings.
TABLE 1 comparison of model prediction Performance evaluation indexes
Figure BDA0003279159230000101

Claims (4)

1. A corrosion rate prediction method for an SVM heavy oil pipeline based on PSO-WOA hybrid optimization is characterized by comprising the following steps:
s1, selecting environment factors which are representative and relevant to corrosion behaviors in the operation process of the thick oil pipeline as input variables;
s2, detecting relevant parameters along the pipeline on site by taking the thick oil pipeline as a research object, and sorting detection data to serve as a model data set;
s3, selecting 22 groups of sample data as training samples, establishing a thick oil pipeline corrosion rate prediction model, using 8 groups of sample data as test samples, and evaluating the optimized model precision;
s4, establishing a corrosion rate prediction model of the SVM heavy oil pipeline based on PSO-WOA hybrid optimization;
and step S5, evaluating the model prediction effect according to the relevant evaluation indexes.
2. The PSO-WOA hybrid optimization-based SVM thick oil pipeline corrosion rate prediction method as claimed in claim 1, wherein the representative and relevant environmental factors of thick oil pipeline corrosion behavior in the step S1 comprise soil resistivity, water content and Cl along the pipeline-Content, potential gradient, oxidation-reduction potential, pH value.
3. The PSO-WOA hybrid optimization-based SVM thick oil pipeline corrosion rate prediction method as claimed in claim 1, wherein in the step S4, SVM is used as a basic neural network model for thick oil pipeline corrosion rate prediction, and the method is implemented by the following steps:
(1) the basic principle of SVM is through a non-linear mapping function
Figure FDA0003279159220000013
Mapping an input sample x to a high-dimensional feature space F, creating a linear regression function according to the principle of minimizing the structural risk, converting each group of data in a training sample into the high-dimensional space, and performing linear regression on the data in the high-dimensional space, thereby converting the nonlinear fitting problem of an original sample into a sample in the high-dimensional spaceThe fitting function obtained by the linear regression problem of (1) is:
y′=f(x)=w·Φ(x)+b (1)
wherein x is the input vector of the sample, w is the weight vector, w belongs to R, b is the deviation vector of the sample, b belongs to R, y' is the predicted value;
when solving the regression fitting problem by SVM, fitting errors are considered and allowed, and a linear insensitive loss function (epsilon) is introduced on the basis of the support vector machine to obtain a regression support vector machine, thus, the regression problem is converted into a solution of an objective function minimizing the structural risk, i.e., values of w and b of the objective function are minimized,
Figure FDA0003279159220000011
wherein C is>0, which is a penalty factor, which controls the penalty of each sample to exceed the error epsilon, and in order to reduce the error generated during the training, relaxation factors ζ i and ζ i' are introduced, respectively
Figure FDA0003279159220000012
The upper limit and the lower limit of the sample training error under the condition of (1) represent a degree of deviation of the sample from an outlier or from a boundary, epsilon refers to a parameter of a linear insensitive loss function, and when the absolute error of a predicted value and a measured value is less than epsilon, the absolute error is ignored; otherwise, it will be included in the error;
(2) introducing Lagrange multiplier a when solving equationiAnd biThe Lagrange function is constructed, the function expression of the problem is regarded as a convex quadratic programming problem, so that the parameter partial derivatives can be solved respectively, and the dual is an initial formula
Figure FDA0003279159220000021
Is converted into
Figure FDA0003279159220000022
On the one hand they are similar, and on the other hand they areTo solve for w, b first, for λ, λ has a value if and only if the data falls on the two imaginary lines; for other samples, λ does not work, i.e. λ only works on the support vector, the problem solution is simplified; therefore, after the dual problem is converted, convex optimization is simplified into maximization of a quadratic form, and a saddle point of a Lagrangian equation can be solved; determining and setting the partial derivative of each variable to zero; after introducing lagrangian and using dual principle, convert to:
Figure FDA0003279159220000023
(3) when solving the non-linear problem by means of SVM, the input samples x are passed through a non-linear mapping function
Figure FDA0003279159220000029
Is mapped onto a high-dimensional feature space F, and then a linear regression of the high-dimensional feature space is performed, the transformation from the low-dimensional space to the high-dimensional space being by a kernel function
Figure FDA0003279159220000024
The function can not replace dot products in a high-dimensional space, and the use of a nonlinear mapping function is avoided
Figure FDA0003279159220000025
The calculation time and complexity are greatly reduced; the radial basis (Radialbasis) function is used, as follows:
Figure FDA0003279159220000026
where g is the width of the kernel function, i.e. the kernel parameter (g)>0),xi-xjIs Euclidean norm, and after introducing kernel parameters, optimization target conversion is as follows:
Figure FDA0003279159220000027
solving the SVM nonlinear regression model function as follows:
Figure FDA0003279159220000028
x1,x2,…,xnis an input variable, ai-biAre network weights and each output vector is a linear transformation of the intermediate node support vector with respect to f (x).
4. The PSO-WOA hybrid optimization-based SVM heavy oil pipeline corrosion rate prediction method as claimed in claim 1, wherein in the step S4, a PSO-WOA hybrid optimization method is used for optimizing parameters of an SVM model, and the method is implemented by the following steps:
(1) the steps of optimizing the penalty factor C and the kernel parameter g through the PSO algorithm are as follows:
initialization: randomly assigning the speed and position of the particle and learning factor c1And c2Carrying out assignment to obtain a penalty factor C and a kernel parameter g of the SVM;
and (3) fitness evaluation: calculating fitness function values of all particles, and initializing a local optimal value and a global optimal value;
and (3) updating: updating the velocity and position of the particle to obtain a new population, comparing the fitness value with its own historical optimum, and updating the global optimum of the population parameters C and g, the velocity (v) of the particle and its current position (CB) being updated according to equations (7) and (8),
vt+1=wvt+c1r1(Pbestt-CBt)+c2r2(Gbestt-CBt) (7)
CBt+1=CBt+vt (8)
where t denotes the number of iterations, r1And r2Is [0,1 ]]Two random variables of (1), c1And c2Is the learning coefficient, Pbest is the particle optimal position, and Gbest is the particle swarm optimal position;
(2) the specific steps of the WOA optimization algorithm are as follows:
given a random number p e (0,1), if p <0.5 and | a | <1, we randomly find prey, the artificial whale algorithm uses random individual positions in its population for food finding, and updates their spatial positions using the following formula:
Xt+1=Xrand-A·D (9)
t denotes the number of iterations that have been performed, the individual position is denoted by X, and the individual X is randomly selected before the position is updatedrandThe total length of (2) is represented by D ═ C · Xrand-XtI represents that the parameter A is in [ -2,2]Generated randomly, and in addition, random individual XrandEffect on distance of present Individual X Using C as [0,2 ]]Random number representation;
if p <0.5 and | A | >1, continue to wrap around the prey,
after the artificial whale has searched for food, the spatial location is updated with the following equation:
Xt+1=Xbest-A·|C·Xbest-Xt| (10)
wherein the position of the food corresponds to XbestThe location of the globally optimal individual in the population;
if p is more than or equal to 0.5, carrying out spiral predation;
the characteristics of the motion track of the artificial whale and the logarithmic spiral are consistent, and the artificial whale can swim to the optimal individual XbestIt also updates its spatial location:
Xt+1=Dbest·ebl·cos2πl+Xt (11)
after iterative update with Xt+1X representing whale position, single X before position updatebestLength of (D) ═ Xbest-XtI calculation, constant of spiral track forming is expressed by b, and is in [ -1,1 [)]Assigning a value to l randomly;
substituting the optimized model parameters into an SVM model to calculate an adaptive value, wherein a fitness calculation formula of an objective function when the WOA is combined with the SVM to carry out regression prediction is as follows:
Figure FDA0003279159220000031
where M is the number of samples, yi、yiSetting a WOA optimization target as c and g parameters of an SVM model and taking an obtained optimal solution as an SVM model parameter, wherein the WOA optimization target is a true value and a model prediction value;
(3) a new solution aiming at the organic fusion of the PSO of the WOA in the exploration stage and the development stage;
the initial population is started and updated by the PSO, and then the obtained solution is updated again by the WOA,
vt+1=wvt+c1r1(Whalebestt-CBt)+c2r2(Gbestt-CBt) (13)
as shown in formula (13), the WOA optimization result is fused into a PSO mathematical model formula (7), the particle swarm position is updated according to a new equation, the optimal position of the particle responsible for solving the optimal solution of the complex nonlinear problem is replaced by a while position, the related decision variables are updated, the solution is efficiently guided to the optimal solution, the WOA enables the particle to reach the optimal value more quickly, the calculation time is reduced, and finally, if the determined iteration number is reached, the developed PSO-WOA optimization process is ended.
CN202111127589.8A 2021-09-26 2021-09-26 SVM heavy oil pipeline corrosion rate prediction method based on PSO-WOA hybrid optimization Pending CN113807598A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111127589.8A CN113807598A (en) 2021-09-26 2021-09-26 SVM heavy oil pipeline corrosion rate prediction method based on PSO-WOA hybrid optimization

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111127589.8A CN113807598A (en) 2021-09-26 2021-09-26 SVM heavy oil pipeline corrosion rate prediction method based on PSO-WOA hybrid optimization

Publications (1)

Publication Number Publication Date
CN113807598A true CN113807598A (en) 2021-12-17

Family

ID=78896688

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111127589.8A Pending CN113807598A (en) 2021-09-26 2021-09-26 SVM heavy oil pipeline corrosion rate prediction method based on PSO-WOA hybrid optimization

Country Status (1)

Country Link
CN (1) CN113807598A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114565185A (en) * 2022-03-28 2022-05-31 北京化工大学 Corrosion rate prediction system based on multi-source data
CN114818927A (en) * 2022-04-26 2022-07-29 北京化工大学 Data-driven equipment corrosion prediction method
CN115099151A (en) * 2022-07-01 2022-09-23 西南石油大学 Pipeline corrosion rate prediction method based on GWO-BP correction mechanism model
CN116224870A (en) * 2023-03-02 2023-06-06 东北农业大学 Intelligent planting environment control system and method based on multi-network fusion and plant photosynthesis feedback

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108204944A (en) * 2018-01-13 2018-06-26 福州大学 The Buried Pipeline rate prediction method of LSSVM based on APSO optimizations
CN112308288A (en) * 2020-09-29 2021-02-02 百维金科(上海)信息科技有限公司 Particle swarm optimization LSSVM-based default user probability prediction method
CN113159404A (en) * 2021-04-12 2021-07-23 山东农业大学 Electric field seed treatment optimal parameter prediction method, system and terminal based on WOA-SVM
CN113204925A (en) * 2021-06-02 2021-08-03 辽宁大学 Strip steel thickness prediction method for improving whale optimization least square support vector machine
CN113392587A (en) * 2021-06-16 2021-09-14 中国地质调查局西安地质调查中心(西北地质科技创新中心) Parallel support vector machine classification method for large-area landslide risk evaluation

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108204944A (en) * 2018-01-13 2018-06-26 福州大学 The Buried Pipeline rate prediction method of LSSVM based on APSO optimizations
CN112308288A (en) * 2020-09-29 2021-02-02 百维金科(上海)信息科技有限公司 Particle swarm optimization LSSVM-based default user probability prediction method
CN113159404A (en) * 2021-04-12 2021-07-23 山东农业大学 Electric field seed treatment optimal parameter prediction method, system and terminal based on WOA-SVM
CN113204925A (en) * 2021-06-02 2021-08-03 辽宁大学 Strip steel thickness prediction method for improving whale optimization least square support vector machine
CN113392587A (en) * 2021-06-16 2021-09-14 中国地质调查局西安地质调查中心(西北地质科技创新中心) Parallel support vector machine classification method for large-area landslide risk evaluation

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
徐慧 等: "改进WOA算法优化SVM的网络入侵检测", 实验室研究与探索, vol. 38, no. 8, pages 128 - 133 *
童林 等: "改进鲸鱼优化支持向量机的交通流量模糊粒化预测", 计算机应用, vol. 41, no. 10, pages 2919 - 2927 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114565185A (en) * 2022-03-28 2022-05-31 北京化工大学 Corrosion rate prediction system based on multi-source data
CN114818927A (en) * 2022-04-26 2022-07-29 北京化工大学 Data-driven equipment corrosion prediction method
CN114818927B (en) * 2022-04-26 2024-07-16 北京化工大学 Data-driven equipment corrosion prediction method
CN115099151A (en) * 2022-07-01 2022-09-23 西南石油大学 Pipeline corrosion rate prediction method based on GWO-BP correction mechanism model
CN116224870A (en) * 2023-03-02 2023-06-06 东北农业大学 Intelligent planting environment control system and method based on multi-network fusion and plant photosynthesis feedback
CN116224870B (en) * 2023-03-02 2023-08-18 东北农业大学 Intelligent planting environment control system and method based on multi-network fusion and plant photosynthesis feedback

Similar Documents

Publication Publication Date Title
CN113807598A (en) SVM heavy oil pipeline corrosion rate prediction method based on PSO-WOA hybrid optimization
Liu et al. Boosting slime mould algorithm for parameter identification of photovoltaic models
Kalogirou et al. Artificial neural networks for the prediction of the energy consumption of a passive solar building
CN105260786B (en) A kind of simulation credibility of electric propulsion system assessment models comprehensive optimization method
CN112733997B (en) Hydrological time series prediction optimization method based on WOA-LSTM-MC
CN111062508A (en) Method for evaluating real-time running state of wind turbine generator based on big data technology
CN108204944A (en) The Buried Pipeline rate prediction method of LSSVM based on APSO optimizations
Syama et al. A hybrid extreme learning machine model with lévy flight chaotic whale optimization algorithm for wind speed forecasting
CN113326969A (en) Short-term wind speed prediction method and system based on improved whale algorithm for optimizing ELM
CN112989711B (en) Aureomycin fermentation process soft measurement modeling method based on semi-supervised ensemble learning
Yalpır Enhancement of parcel valuation with adaptive artificial neural network modeling
CN115828768A (en) Data-driven power distribution network reactive power prediction method
CN112765902A (en) RBF neural network soft measurement modeling method based on TentFWA-GD and application thereof
Fu et al. A building energy consumption prediction method based on integration of a deep neural network and transfer reinforcement learning
Çevik et al. Day ahead wind power forecasting using complex valued neural network
CN115310348A (en) Stacking-based grouting amount integrated agent prediction model and prediction method
CN116578551A (en) GRU-GAN-based power grid data restoration method
CN111222669A (en) Overhead line cost prediction method and device
Wang et al. Highway Cost Prediction Based on LSSVM Optimized by Intial Parameters.
CN117291069A (en) LSTM sewage water quality prediction method based on improved DE and attention mechanism
CN117312790A (en) Voltage transformer error prediction method, device, equipment and readable storage medium
CN112163632A (en) Application of semi-supervised extreme learning machine based on bat algorithm in industrial detection
CN111310974A (en) Short-term water demand prediction method based on GA-ELM
CN116054144A (en) Distribution network reconstruction method, system and storage medium for distributed photovoltaic access
CN115775038A (en) Short-term load prediction method based on IGWO optimization LSSVM

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination