In-pipeline detector positioning method based on CNN classification and RNN prediction

文档序号:499588 发布日期:2022-01-07 浏览:21次 中文

阅读说明:本技术 基于cnn分类和rnn预测的管道内检测器定位方法 (In-pipeline detector positioning method based on CNN classification and RNN prediction ) 是由 蔡永桥 卢进 唐建华 倪先锋 魏海 赵可天 徐龙 王金榜 徐永杰 任长弘 于 2021-08-20 设计创作,主要内容包括:本发明公开了一种基于CNN分类和RNN预测的管道内检测器定位方法,对原始管道振动信号样本进行归一化和分类截取预处理,得到预处理样本集,然后对预处理样本集进行降噪处理及特征提取,得到训练样本集;建立CNN模型,对管道振动信号进行分类识别;建立RNN模型,对管道振动信号进行管道内检测器的位置预测;采用训练样本集对CNN模型进行训练,采用CNN模型输出的已分类识别的训练样本集对RNN模型进行训练;将实时采集的管道振动信号,依次经过均已完成训练的CNN模型和RNN模型处理,得到管道内检测器的定位数据。本发明将CNN模型的分类识别和RNN模型预测相结合,提高内检测器定位系统的精准度以及指向性能。(The invention discloses a CNN classification and RNN prediction-based in-pipeline detector positioning method, which comprises the steps of carrying out normalization and classification interception pretreatment on an original pipeline vibration signal sample to obtain a pretreatment sample set, and then carrying out noise reduction treatment and feature extraction on the pretreatment sample set to obtain a training sample set; establishing a CNN model, and carrying out classification and identification on the pipeline vibration signals; establishing an RNN model, and predicting the position of a detector in the pipeline on the pipeline vibration signal; training the CNN model by adopting a training sample set, and training the RNN model by adopting a training sample set which is output by the CNN model and is classified and recognized; and sequentially processing the pipeline vibration signals acquired in real time by the CNN model and the RNN model which are trained to obtain the positioning data of the detector in the pipeline. The invention combines the classification identification of the CNN model and the prediction of the RNN model, and improves the accuracy and pointing performance of the internal detector positioning system.)

1. A CNN classification and RNN prediction-based in-pipeline detector positioning method is characterized in that an original pipeline vibration signal sample is subjected to normalization and classification interception preprocessing to obtain a preprocessing sample set, and then the preprocessing sample set is subjected to noise reduction processing and feature extraction to obtain a training sample set; establishing a CNN model for classifying and identifying the pipeline vibration signals; establishing an RNN (neural network) model for predicting the position of the detector in the pipeline on the classified and identified pipeline vibration signals; training the CNN model by adopting a training sample set, and carrying out classification and identification on the training sample set by the trained CNN model to obtain a classified and identified training sample set; training the RNN model by adopting a classified and recognized training sample set; and sequentially processing the pipeline vibration signals acquired in real time by the CNN model and the RNN model which are trained to obtain the positioning data of the detector in the pipeline.

2. The method for in-pipeline detector localization based on CNN classification and RNN prediction according to claim 1, comprising the steps of:

step1, extracting original data of a pipeline signal as an original data sample set, and carrying out normalization and correction processing on the original data sample set; classifying and intercepting the processed original data sample set according to the working condition category to obtain a sample set A;

step2, carrying out noise reduction treatment on the sample set A by using a wavelet packet decomposition-soft threshold method to obtain the sample set A1(ii) a Extracting time-frequency domain characteristics of the sample set A to obtain a signal characteristic sample set A2(ii) a Extracting energy spectrum characteristics of the sample set A to obtain a signal energy spectrum characteristic sample set A3

Step3, constructing a CNN model to classify and identify the sample set, and classifying A1、A2、A3As input to the CNN model;

step 4, constructing an RNN model to predict the ball passing time of the detector in the pipeline, and taking the output of the CNN model as the input of the RNN model;

step 5, from sample set A1、A2、A3One part of the training samples is selected as a training sample set, and the other parts are used as a testing sample set; by trainingTraining a CNN model and an RNN model by a sample set; testing the CNN model and the RNN model by using the test sample set;

step 6, processing the pipeline vibration signals acquired in real time according to the method for processing the sample set A in the step 2; and sequentially carrying out the trained CNN model and RNN model on the processed data to obtain the ball passing time of the in-pipeline detector.

3. The method for positioning the detector in the pipeline based on the CNN classification and the RNN prediction as claimed in claim 2, wherein in the step1, a sliding and overlapping time window is adopted to extract the data of the pipeline vibration signal; normalizing the data sample set by adopting a Z-score standardization method; and carrying out correction processing on the data sample set by using a median correction method.

4. The method as claimed in claim 2, wherein in step2, let a ═ X be set as sample set ai1;Xi2;…Xig…;XiM](ii) a Wherein i is a working condition category; xigThe g data of the i type data sample set; m is the number of samples; carrying out noise reduction treatment by using a wavelet packet decomposition-soft threshold method; obtaining a t x t wavelet modulus mean matrixExtracting characteristics by a Markov method; get the matrix of t x tExtracting energy spectrum characteristics by a Markov method to obtain a coefficient time-frequency diagram of t multiplied by tWhere t × t ═ M.

5. The method for positioning in-pipeline detectors based on CNN classification and RNN prediction as claimed in claim 4, wherein the specific method for denoising the sample set A by wavelet packet decomposition-soft threshold is as follows: subjecting the signal to db 7-based 3-layer wavelet packet decomposition; and inverse wavelet reconstruction is performed on the wavelet packet decomposition coefficients.

6. The method of claim 4, wherein the step2 comprises the following sub-steps:

step A1, selecting the upper and lower boundaries of the Markov chain:B. a respectively represents the upper boundary and the lower boundary of the window; whereinMeans, X, representing the data segmentmax、XminRespectively representing the maximum value and the minimum value of the data segment; taking the boundary proportionality coefficient lambda of the window as 0.01;

step a2, dividing the number of states into 5, and setting step1 of initial state to Q1-a; let step2 be Q for the intermediate statei+1-Qi{ i ═ 1,2,3 }; let step3 be B-Q4(ii) a Wherein Q1Is the 1/5 quantile, Q, of the data segment44/5 quantile for the data segment;

step a3, constructing a Markov chain: converting the leakage magnetic signal from x (i) to s (i); when x (i) e (A, A + step 1)]When s (i) is 1; when x (i) epsilon (Q)i,Qi+step2]When s (i) ═ i +1{ i ═ 1,2,3 }; when x (i) epsilon (Q)4,Q4+step3],s(i)=5;

Step A4, extracting Markov characteristics:whereinIn order to be the number of state upshifts,number of state downshifts, kiThe state is the state holding times, s (j) is the state at the moment j, s (j +1) is the state at the moment j +1, and L represents the length of the data segment in the window; converting the transition time matrix of each state obtained by the previous step into a one-dimensional row vectorBy passingObtaining a state transition probability matrix; where K is the corresponding state transition times matrix, K[i][j]The number of transitions from state i to state j.

7. The method of claim 2, wherein in step3, the CNN model is constructed based on VGG16 model.

8. The method of claim 7, wherein step3 comprises the following sub-steps:

step B1, sample set A1、A2、A3When data is input into the convolutional layer, performing convolution operation on the characteristics input into the convolutional layer by the convolutional core in the convolutional layer according to the size and the step length of the convolutional core;Loutfor the input size of the current convolutional layer, LinInputting the size of the current layer, wherein K is the convolution kernel size of the current convolution layer, and S is the convolution step length of the previous layer; the mathematical formula for performing convolution operation on the input of the current layer by the convolution kernel is For the current convolutional layer input, kijWeight matrix for the current convolutional layer, bjIs the bias term vector of the current convolutional layer, fcov() In order to perform the convolution operation,is the output after the current convolution layer operation;

b2, the data sample set is packed into a pooling layer through a convolution layer, and the pooling layer carries out down-sampling processing on the data; selecting a ReLU activation function frelu(x) Max (0, x) as a nonlinear activation function, connecting the convolutional layer and the fully-connected layer; is the input of the full connection layer,for full link layer output, wijAs a weight matrix between the input and output of the full connection layer, bjIn order to be a vector of bias terms,is an activation function;

step B3, using loss function L (p, y) — Σ yn log(pn),n∈[1,N]Calculating the difference between the estimated output and the real label, wherein y is the real label output, p is the probability of all output categories, and N is the number of neurons in an output layer; using Softmax functionThe probability of each class is calculated and,for non-homing of a previous time in the networkNormalizing the output result; in optimizing convolutional neural network parameters using a cross entropy loss function KL (p/, y) L (p, y) -H (p), where KL (p/, y) is to minimize KL divergence between prediction output p and real label y, and L (p, y), H (p) are cross entropy L and entropy H of minimization of prediction output p and real label y, respectively.

9. The CNN classification and RNN prediction based in-pipeline detector localization method of claim 1, wherein a Bi-LSTM based RNN model is established; and optimizing network parameters of the RNN model by adopting a Dropout model and a BN model.

Technical Field

The invention relates to a method for positioning a detector in a pipeline, in particular to a method for positioning a detector in a pipeline based on CNN classification and RNN prediction.

Background

At present, with the rapid development of the world economy, petroleum resources gradually become the most important energy and chemical raw materials in the world. This reality forces the transportation of oil to become a topic that is currently being asked for. At present, the transportation of petroleum resources mainly comprises four modes: rail transport, road transport, water transport, and pipeline transport. Among them, pipeline transportation of petroleum plays an increasingly important role in the fields of national economy and national defense construction. With the rapid increase of the total mileage of pipelines in China, the phenomena of pipeline corrosion, artificial damage and aging cracking frequently occur, huge economic loss is caused, and meanwhile, the environment is seriously polluted. The most widely applied detection method at present is a magnetic flux leakage detection method for pipeline inspection by using an internal detector of the pipeline, and an external positioning technology of the internal detector is an extremely important component of a pipeline detection system.

Different in-pipeline detector positioning methods have different advantages and disadvantages and application ranges. Through comparing and analyzing various technologies for positioning the in-pipeline detector based on different principles at home and abroad, the fact that the technologies can realize positioning of internal detection can be found, but the technologies have certain limitations in practical application. At present, the oil and gas pipeline transportation in China is fast in development speed, and a primary scale trans-regional oil and gas pipeline network is formed. However, when the mileage of the pipelines is rapidly increased, a plurality of old pipelines enter a period of multiple accidents after decades of oil and gas transportation, and meanwhile, the pipelines are frequently leaked and exploded due to the damage to the pipelines, the corrosion to the pipelines and other reasons caused by artificial theft, so that the land and marine ecological environments are seriously damaged while huge losses are caused to the lives and properties of people. Therefore, it is very important to accurately position the internal detector in the pipeline for safe transportation of petroleum resources.

In the prior internal detector positioning devices installed on site in many pipeline projects in China, except for mechanical firing pin type equipment, the positions of internal detectors are mostly judged by a method based on permanent magnets, and the internal detector positioning devices are not applicable to pipe cleaners and deformed internal detectors without permanent magnets. The technology for positioning the inner detector based on the vibration signal tracks the operation of the inner detector by utilizing the friction between a leather cup of the inner detector and a pipe wall. When the inner detector moves to the position right below the acquisition point, the friction vibration signal obtained by the acquisition point reaches the maximum, and the moment corresponding to the maximum vibration signal point is the moment when the inner detector passes through the mark point, so that the mark positioning of the inner detector is realized. Therefore, the internal detector positioning technology based on the vibration signals does not need to pre-install a source emission device on the internal detector, is suitable for the internal detector whether equipped with a permanent magnet or not, and can realize tracking and positioning no matter a pipe cleaner or a drift diameter instrument. However, in some more automated construction sites, even if a system based on vibration signal positioning is installed, the system is only used in the middle pipe section with less background interference. The reason is that along with the development of petroleum pipeline industry, the manual operation of the first and last stations of the pipeline is more, and if workers operate valves, workers open valves to unload oil, and start pumps to increase pressure, working condition interference is generated on pipeline vibration signals, and the accuracy of a positioning system is affected. Meanwhile, the first and last stations of the pipeline are generally close to a factory or a road, and the ground vibration generated around the pipeline is very strong. At present, although some pipeline engineering uses positioning technology based on vibration signals, the positioning technology should be applied to the middle pipe section with less interference from the background. Under the complex environment background and the changeable pipeline working condition, because the algorithm can not distinguish the vibration source of the vibration signal, the error judgment is easily generated when the inner detector really passes through the mark point. From above, it can be seen that, discernment vibration signal's vibration source under complex environment background and changeable pipeline operating mode to improve internal detector positioning system's precision and directive property, be one of the difficult problem that needs to solve in the current pipeline detector location field urgently.

Disclosure of Invention

The invention provides a method for positioning a detector in a pipeline based on CNN classification and RNN prediction, which aims to solve the technical problems in the prior art.

The technical scheme adopted by the invention for solving the technical problems in the prior art is as follows:

a CNN classification and RNN prediction-based in-pipeline detector positioning method comprises the steps of carrying out normalization and classification interception pretreatment on an original pipeline vibration signal sample to obtain a pretreatment sample set, and then carrying out noise reduction treatment and feature extraction on the pretreatment sample set to obtain a training sample set; establishing a CNN model for classifying and identifying the pipeline vibration signals; establishing an RNN (neural network) model for predicting the position of the detector in the pipeline on the classified and identified pipeline vibration signals; training the CNN model by adopting a training sample set, and carrying out classification and identification on the training sample set by the trained CNN model to obtain a classified and identified training sample set; training the RNN model by adopting a classified and recognized training sample set; and sequentially processing the pipeline vibration signals acquired in real time by the CNN model and the RNN model which are trained to obtain the positioning data of the detector in the pipeline.

Further, the method comprises the steps of:

step1, extracting original data of a pipeline signal as an original data sample set, and carrying out normalization and correction processing on the original data sample set; classifying and intercepting the processed original data sample set according to the working condition category to obtain a sample set A;

step2, carrying out noise reduction treatment on the sample set A by using a wavelet packet decomposition-soft threshold method to obtain the sample set A1(ii) a Extracting time-frequency domain characteristics of the sample set A to obtain a signal characteristic sample set A2(ii) a Extracting energy spectrum characteristics of the sample set A to obtain a signal energy spectrum characteristic sample set A3

Step3, constructing a CNN model to classify and identify the sample set, and classifying A1、A2、A3As input to the CNN model;

step 4, constructing an RNN model to predict the ball passing time of the detector in the pipeline, and taking the output of the CNN model as the input of the RNN model;

step 5, from sample set A1、A2、A3One part of the training samples is selected as a training sample set, and the other parts are used as a testing sample set; training a CNN model and an RNN model by using a training sample set; testing the CNN model and the RNN model by using the test sample set;

step 6, processing the pipeline vibration signals acquired in real time according to the method for processing the sample set A in the step 2; and sequentially carrying out the trained CNN model and RNN model on the processed data to obtain the ball passing time of the in-pipeline detector.

Further, in the step1, a sliding and overlapping time window is adopted to extract data of the pipeline vibration signal; normalizing the data sample set by adopting a Z-score standardization method; and carrying out correction processing on the data sample set by using a median correction method.

Further, in step2, let sample set a ═ Xi1;Xi2;…Xig…;XiM](ii) a Wherein i is a working condition category; xigThe g data of the i type data sample set; m is the number of samples; carrying out noise reduction treatment by using a wavelet packet decomposition-soft threshold method; obtaining a t x t wavelet modulus mean matrixExtracting characteristics by a Markov method; get the matrix of t x tExtracting energy spectrum characteristics by a Markov method to obtain a coefficient time-frequency diagram of t multiplied by tWhere t × t ═ M.

Further, a specific method for performing noise reduction processing on the sample set a by using a wavelet packet decomposition-soft threshold method is as follows: subjecting the signal to db 7-based 3-layer wavelet packet decomposition; and inverse wavelet reconstruction is performed on the wavelet packet decomposition coefficients.

Further, step2 comprises the following sub-steps:

step A1, selecting the upper and lower boundaries of the Markov chain:B. a respectively represents the upper boundary and the lower boundary of the window; whereinMeans, X, representing the data segmentmax、XminRespectively representing the maximum value and the minimum value of the data segment; taking the boundary proportionality coefficient lambda of the window as 0.01;

step a2, dividing the number of states into 5, and setting step1 of initial state to Q1-a; let step2 be Q for the intermediate statei+1-Qi{ i ═ 1,2,3 }; let step3 be B-Q4(ii) a Wherein Q1Is the 1/5 quantile, Q, of the data segment44/5 quantile for the data segment;

step a3, constructing a Markov chain: converting the leakage magnetic signal from x (i) to s (i); when x (i) e (A, A + step 1)]When s (i) is 1; when x (i) epsilon (Q)i,Qi+step2]When s (i) ═ i +1{ i ═ 1,2,3 }; when x (i) epsilon (Q)4,Q4+step3],s(i)=5;

Step A4, extracting Markov characteristics:whereinIn order to be the number of state upshifts,number of state downshifts, kiThe state is the state holding times, s (j) is the state at the moment j, s (j +1) is the state at the moment j +1, and L represents the length of the data segment in the window; converting the transition time matrix of each state obtained by the previous step into a one-dimensional row vectorBy passingObtaining a state transition probability matrix; where K is the corresponding state transition times matrix, K[i][j]The number of transitions from state i to state j.

Further, in step3, the CNN model is constructed based on the VGG16 model.

Further, step3 comprises the following sub-steps:

step B1, sample set A1、A2、A3When data is input into the convolutional layer, performing convolution operation on the characteristics input into the convolutional layer by the convolutional core in the convolutional layer according to the size and the step length of the convolutional core;Loutfor the input size of the current convolutional layer, LinInputting the size of the current layer, wherein K is the convolution kernel size of the current convolution layer, and S is the convolution step length of the previous layer; the mathematical formula for performing convolution operation on the input of the current layer by the convolution kernel is For the current convolutional layer input, kijFor the current convolutional layerWeight matrix, bjIs the bias term vector of the current convolutional layer, fcov() For convolution operations, xj outIs the output after the current convolution layer operation;

step B2, the data sample set is from the convolution layer to the pooling layer, and the pooling layer carries out down-sampling processing on the data; selecting a ReLU activation function frelu(x) Max (0, x) as a nonlinear activation function, connecting the convolutional layer and the fully-connected layer; is the input of the full connection layer,for full link layer output, wijAs a weight matrix between the input and output of the full connection layer, bjAs a vector of bias terms, ffc() Is an activation function;

step B3, using loss function L (p, y) — Σ yn log(pn),n∈[1,N]Calculating the difference between the estimated output and the real label, wherein y is the real label output, p is the probability of all output categories, and N is the number of neurons in an output layer; using Softmax functionThe probability of each class is calculated and,outputting the result for the previous non-normalization in the network; when a cross entropy loss function KL (p | | | y) ═ L (p, y) -H (p) is used to optimize the convolutional neural network parameters, KL (p | | | y) is the KL divergence between the minimized prediction output p and the real label y, and L (p, y) and H (p) are the cross entropy L and the entropy H of the minimized prediction output p and the real label y, respectively.

Further, establishing an RNN model based on the Bi-LSTM; and optimizing network parameters of the RNN model by adopting a Dropout model and a BN model.

The invention has the advantages and positive effects that:

firstly, the invention carries out signal classification and identification based on the CNN model, so that the signal classification process not only carries out local feature extraction on input, but also can integrate local information of each node to obtain global features. Sharing is carried out by combining the convolution kernel weight, so that the training quantity of network parameters is reduced, and the overfitting degree of the network is reduced;

secondly, the method carries out accurate identification and regression prediction of the ball passing time based on the RNN model, so that the pipeline vibration signal can be transmitted from front to back or from back to front in the Bi-LSTM network, the vibration signal of the pipeline at each time can be linked with the signal data of the front and back time, the aim of reducing the training amount of network parameters is fulfilled, and the characteristics of the pipeline vibration signal can be fully utilized.

Thirdly, the classification and identification of the CNN model and the accurate identification network of the ball passing time of the RNN model are combined, various working condition actual measurement samples are comprehensively considered, and the formed in-pipeline detector positioning method can accurately identify the vibration source of the vibration signal under the complex environment background and the variable pipeline working conditions, so that the accuracy and the pointing performance of the in-pipeline detector positioning system are improved.

Drawings

FIG. 1 is a flow chart of the method for positioning a detector in a pipeline based on CNN classification and RNN prediction according to the present invention.

Fig. 2 is a basic structural diagram of a CNN model of the present invention.

Fig. 3 is a diagram of a CNN model structure according to the present invention.

Fig. 4 is a working flow chart of a CNN model according to the present invention.

Fig. 5 is a graph comparing accuracy rates of a CNN model according to the present invention and a conventional CNN model with respect to a pipe vibration signal.

Fig. 6 is a graph comparing loss error of a CNN model according to the present invention and a conventional CNN model with respect to a pipe vibration signal.

FIG. 7 is a diagram of a basic RNN model according to the present invention.

FIG. 8 is a diagram of a Bi-LSTM-based RNN model according to the present invention.

FIG. 9 is a flowchart of an RNN model operation according to the present invention.

Detailed Description

For further understanding of the contents, features and effects of the present invention, the following embodiments are enumerated in conjunction with the accompanying drawings, and the following detailed description is given:

the English words and the abbreviated Chinese notes in the invention are as follows:

CNN: convolutional Neural Networks (CNNs) are a class of feed-forward Neural Networks that have been created based on visual cell research heuristics and contain convolution calculations and have a deep structure.

RNN: a Recurrent Neural Network (RNN) is a Recurrent Neural Network in which sequence data is input, recursion is performed in the direction of evolution of the sequence, and all nodes are connected in a chain manner; memory states can be generated for past data, and the data can be related in a time dimension.

An Epoch: when a complete data set passes through the neural network once and back once, the process is called an epoch.

Accuracy: and (4) accuracy.

Bi-LSTM: the Bidirectional Long-Short Term Memory network (Bi-LSTM) combines the information of the input sequence in the forward direction and the backward direction on the basis of the Long-Short Term Memory network (LSTM).

Markov: a Markov chain is a collection of discrete random variables with Markov properties, which also have irreducibility, constant returness, ergodicity, and periodicity.

Dropout: during the training process of the deep learning network, the neural network unit is temporarily discarded from the network according to a certain probability.

BN: an effective local response training optimization method.

Referring to fig. 1 to 9, a method for positioning a detector in a pipeline based on CNN classification and RNN prediction, which performs normalization and classification interception preprocessing on an original pipeline vibration signal sample to obtain a preprocessed sample set, and then performs noise reduction processing and feature extraction on the preprocessed sample set to obtain a training sample set; establishing a CNN model for classifying and identifying the pipeline vibration signals; establishing an RNN (neural network) model for predicting the position of the detector in the pipeline on the classified and identified pipeline vibration signals; training the CNN model by adopting a training sample set, and carrying out classification and identification on the training sample set by the trained CNN model to obtain a classified and identified training sample set; training the RNN model by adopting a classified and recognized training sample set; and sequentially processing the pipeline vibration signals acquired in real time by the CNN model and the RNN model which are trained to obtain the positioning data of the detector in the pipeline.

Further, the method may comprise the steps of:

step1, extracting original data of a pipeline signal to serve as an original data sample set, and normalizing and correcting the original data sample set; classifying and intercepting the processed original data sample set according to the working condition category to obtain a sample set A;

step2, denoising the sample set A by using a wavelet packet decomposition-soft threshold method to obtain the sample set A1(ii) a The time-frequency domain feature extraction can be carried out on the sample set A to obtain a signal feature sample set A2(ii) a The energy spectrum characteristic sample set A can be obtained by extracting the energy spectrum characteristic of the sample set A3

Step3, a CNN model can be constructed to classify and identify the sample set, and A is used1、A2、A3As input to the CNN model.

And 4, constructing an RNN model to predict the ball passing time of the detector in the pipeline, and taking the output of the CNN model as the input of the RNN model.

Step 5, can be from sample set A1、A2、A3One part of the training samples is selected as a training sample set, and the other parts are used as a testing sample set; such as randomly selecting A's corresponding to each other1、A2、A380% of the sample set is a training sample set, and the rest 20% is used as a testing sample set; training CNN model with training sample setAnd an RNN model; testing the CNN model and the RNN model by using the test sample set;

n original data sample sets A can be randomly selected; denoising the sample set A by using a wavelet packet decomposition-soft threshold method to obtain the sample set A1(ii) a The time-frequency domain feature extraction can be carried out on the sample set A to obtain a signal feature sample set A2(ii) a The energy spectrum characteristic sample set A can be obtained by extracting the energy spectrum characteristic of the sample set A3. A is to be1、A2、A3Taking 80% of the data corresponding to each other as a training sample set, and taking the rest 20% as a test sample set; training and testing to obtain a training error of the CNN model; and optimizing the network parameters of the CNN model according to the training error of the CNN model.

Classifying and identifying the training sample set and the test sample set by adopting a trained CNN model to obtain a training sample set and a test sample set which are classified and identified; using the classified and recognized training sample set as a training sample of the RNN model, and using the classified and recognized testing sample set as a testing sample of the RNN model; and training and testing the RNN model, and optimizing network parameters of the RNN model according to the RNN model training error.

Step 6, processing the pipeline vibration signals acquired in real time according to the method for processing the sample set A in the step 2; and sequentially carrying out the trained CNN model and RNN model on the processed data to obtain the ball passing time of the in-pipeline detector.

Setting the pipeline vibration signal collected in real time as B, and carrying out noise reduction treatment on the pipeline vibration signal B collected in real time by using a wavelet packet decomposition-soft threshold method to obtain the pipeline vibration signal B subjected to noise reduction1(ii) a The method can extract the time-frequency domain characteristics of the pipeline vibration signal B acquired in real time to obtain the signal characteristics B of the pipeline vibration signal2(ii) a The energy spectrum characteristic extraction can be carried out on the pipeline vibration signal B acquired in real time to obtain the signal energy spectrum characteristic B of the pipeline vibration signal3. B is to be1、B2、B3Inputting the CNN model as input of the CNN model into the trained CNN model, and inputting the output of the CNN model as input of the RNN modelAnd outputting positioning signal data of the detector in the pipeline.

The method of wavelet packet decomposition-soft threshold may comprise the steps of:

(1) and (3) decomposition process: a wavelet is selected and an N-layer wavelet (wavelet packet) decomposition is performed on the signal.

(2) Action threshold process: and selecting a threshold value for each layer coefficient obtained by decomposition, and performing soft threshold processing on detail coefficients.

(3) And (3) reconstruction process: and (4) restoring the original signal by wavelet (wavelet packet) reconstruction on the processed coefficient.

Further, in the step1, a sliding and overlapping time window can be adopted to extract data of the pipeline vibration signal; the Z-score standardization method can be adopted to normalize the data sample set; the data sample set may be corrected using a median correction method.

Further, in step2, let a sample set a ═ Xi1;Xi2;…Xig…;XiM](ii) a Wherein i is a working condition category; xigThe g data of the i type data sample set; m is the number of samples; denoising by a wavelet packet decomposition-soft threshold method; obtaining a t x t wavelet modulus mean matrixExtracting features by a Markov method; get the matrix of t x tThe energy spectrum characteristic can be extracted by a Markov method to obtain a coefficient time-frequency diagram of t multiplied by tWhere t × t ═ M.

Further, the specific method of denoising the sample set a by using the wavelet packet decomposition-soft threshold method may be as follows: the signal may be subjected to db7 based 3-layer wavelet packet decomposition; and inverse wavelet reconstruction can be performed on the wavelet packet decomposition coefficients.

Further, step2 may comprise the following substeps:

step A1, selecting the upper and lower boundaries of the Markov chain as follows:B. a respectively represents the upper boundary and the lower boundary of the window; whereinMeans, X, representing the data segmentmax、XminRespectively representing the maximum value and the minimum value of the data segment; taking the boundary proportionality coefficient lambda of the window as 0.01;

step a2, dividing the number of states into 5, and setting step1 of initial state to Q1-a; let step2 be Q for the intermediate statei+1-Qi{ i ═ 1,2,3 }; let step3 be B-Q4(ii) a Wherein Q1Is the 1/5 quantile, Q, of the data segment44/5 quantile for the data segment;

step a3, constructing a Markov chain: converting the leakage magnetic signal from x (i) to s (i); when x (i) e (A, A + step 1)]When s (i) is 1; when x (i) epsilon (Q)i,Qi+step2]When s (i) ═ i +1{ i ═ 1,2,3 }; when x (i) epsilon (Q)4,Q4+step3],s(i)=5;

Step A4, extracting Markov characteristics:whereinIn order to be the number of state upshifts,number of state downshifts, kiThe state is the state holding times, s (j) is the state at the moment j, s (j +1) is the state at the moment j +1, and L represents the length of the data segment in the window; converting the transition time matrix of each state obtained by the previous step into a one-dimensional row vectorBy passingObtaining a state transition probability matrix; where K is the corresponding state transition times matrix, K[i][j]The number of transitions from state i to state j.

Further, in step3, the CNN model may be constructed based on the VGG16 model. Selecting a VGG16 model as a basic structure for classification and identification of the pipeline vibration signal; the input structure is 224 multiplied by 3, the improved input layer is still three channels, and the identification object is a sample set A1、A2、A3

Further, step3 may comprise the following substeps:

step B1, sample set A1、A2、A3When data is input into the convolutional layer, performing convolution operation on the characteristics input into the convolutional layer by the convolutional core in the convolutional layer according to the size and the step length of the convolutional core;Loutfor the input size of the current convolutional layer, LinInputting the size of the current layer, wherein K is the convolution kernel size of the current convolution layer, and S is the convolution step length of the previous layer; the mathematical formula for performing convolution operation on the input of the current layer by the convolution kernel is For the current convolutional layer input, kijWeight matrix for the current convolutional layer, bjIs the bias term vector of the current convolutional layer, fcov() For convolution operations, xj outIs the output after the current convolution layer operation;

step B2, the data sample set is from the convolution layer to the pooling layer, and the pooling layer can perform down-sampling processing on the data; selecting a ReLU activation function frelu(x) Max (0, x) as a nonlinear activation function, connecting the convolutional layer and the fully-connected layer; is the input of the full connection layer,for full link layer output, wijAs a weight matrix between the input and output of the full connection layer, bjAs a vector of bias terms, ffc() Is an activation function;

in step B3, a loss function L (p, y) may be used as ∑ yn log(pn),n∈[1,N]Calculating the difference between the estimated output and the real label, wherein y is the real label output, p is the probability of all output categories, and N is the number of neurons in an output layer; using Softmax functionThe probability of each class is calculated and,outputting the result for the previous non-normalization in the network; in optimizing convolutional neural network parameters using a cross entropy loss function KL (p/, y) L (p, y) -H (p), where KL (p/, y) is to minimize KL divergence between prediction output p and real label y, and L (p, y), H (p) are cross entropy L and entropy H of minimization of prediction output p and real label y, respectively.

Further, a Bi-LSTM based RNN model can be established. The Dropout model and the BN model may be employed to optimize network parameters of the RNN model.

Training sample set X ═ X capable of setting RNNi1;Xi2;…Xig…;XiM](ii) a Wherein i is a working condition category; xigThe g data of the i type sample set; m is the number of samples; changing X to [ X ]i1;Xi2;…Xig…;XiM](ii) a Is converted intoAs sample input for RNN model; wherein sxm ═ M; can adopt a mean square error modelTo perform a calculation of a loss function, yiIs the predicted output of the RNN and,m is the number of samples as a real time label; obtaining RNN model training errors; and constructing a Dropout model and a BN model to optimize network parameters of the RNN model.

Inputting the constructed RNN model into an s multiplied by m matrix; collecting the sampless × M ═ M as a sample input of RNN model; let the input at time t be x(t)Hidden state is h(t). The hidden state is calculated as follows: h is(t)=σ(Ux(t)+Wh(t-1)+ b), σ is the hidden layer activation function, U is the cyclic node input weight, W is the state weight, b is the hidden layer bias. h is(t)From x(t)And hidden state h at time t-1(t-1)Obtain the output at time t as y(t),y(t)=λ(Vh(t)+ c), λ is the activation function of the output layer, V is the output layer node weight, and c is the output layer bias. Using mean square errorTo perform a calculation of a loss function, yiIs the predicted output of the RNN and,m is the number of samples for a true time stamp.

The working process and working principle of the present invention are further explained by a preferred embodiment of the present invention as follows:

the invention aims to provide a method for positioning a pipeline internal detector based on CNN classification and RNN prediction, which can realize accurate identification of a vibration signal vibration source under complex environment background and variable pipeline working conditions, thereby improving the accuracy and pointing performance of an internal detector positioning system.

Fig. 1 is a flow chart of a method for positioning an in-pipeline detector based on CNN classification and RNN prediction according to the present invention.

Firstly, normalizing and classifying and intercepting original vibration signal data samples, then carrying out noise reduction processing and feature extraction on the preprocessed original vibration signal data samples to obtain an initial input sample set, building and training a CNN (neural network) model, then carrying out classification and identification on the basis of the CNN model to obtain a classified and identified sample set, building and training an RNN model, and carrying out in-pipeline detector positioning on the classified and identified sample set on the basis of the RNN model; and finally, positioning the in-pipeline detector by the trained CNN classification network and RNN regression network.

The invention discloses a method for positioning a detector in a pipeline based on CNN classification and RNN prediction, which comprises the following steps:

step 1: normalization and classification interception of original vibration signal data samples: extracting an original data sample of a pipeline signal to form an initial vibration signal data sample set, wherein the initial vibration signal data sample is a working condition actual measurement sample; performing data preprocessing on the initial pipeline vibration signal data sample set by adopting a sliding and superposed time window; normalizing the initial pipeline vibration signal data sample set by adopting a Z-score standardization method; correcting the data sample set by using a median correction method; classifying and intercepting the collected pipeline vibration signal data; obtaining a raw data sample set Xi=[Xi1;Xi2;…Xig…;XiM](ii) a M is the number of the sample set X; i is a working condition type; xigThe g data of the i type data sample set; n parts of each type;

step 1.1: the method using Z-score normalization has a transfer function as shown inμ is the data sample expectation and σ is the sample data standard deviation;

step 1.2: the median correction method adopted is Represents the magnetic field intensity of the ith sensor at the jth mileage point after the calibration of the basic value, BjRepresenting the magnetic field intensity of the ith sensor at the jth mileage point before the calibration of the basic value, k representing the channel number of the sensor, VmedianIs the median voltage, V, of the ith sensorrefThe reference voltage value of the Hall sensor is shown, P is the amplification factor, and sens is the sensitivity value of the Hall sensor.

In this embodiment, M is 5184, i is 1,2,3, 4, n is 700; the states of the pipeline and the internal detector corresponding to the vibration signal are divided into the following four types: the in-pipeline detector collects 700 samples of each type through a welding seam process signal (I), a signal collection point process signal (II), a welding seam failure of the in-pipeline detector through a collection point, a working condition interference signal (III) of the pipeline failure and a working condition interference or artificial interference process signal (IV) of the pipeline failure.

The step2 comprises the following steps:

step 2.1: carrying out noise reduction treatment by a wavelet packet decomposition-soft threshold method: calculating wavelet packet transformation of an original pipeline vibration signal: the invention selects db7 as wavelet basis, the decomposition level is 3, and 3-layer wavelet packet decomposition based on db7 is carried out on the signal. And carrying out inverse wavelet reconstruction on the wavelet packet decomposition coefficient to obtain a filtered signal.

Step 2.2 comprises the following steps:

step 2.2.1: the upper and lower boundaries of the Markov chain were chosen as follows:B. a respectively represents the upper boundary and the lower boundary of the window; whereinTo representMean, X, of the data segmentmax、XminRespectively representing the maximum value and the minimum value of the data segment; taking the boundary proportionality coefficient lambda of the window as 0.01;

step 2.2.2: the number of states is divided into 5, and the step1 of the initial state is set as Q1-a; let step2 be Q for the intermediate statei+1-Qi{ i ═ 1,2,3 }; let step3 be B-Q4(ii) a Wherein Q1Is the 1/5 quantile, Q, of the data segment44/5 quantile for the data segment;

step 2.2.3: constructing a Markov chain: converting the leakage magnetic signal from x (i) to s (i); when x (i) e (A, A + step 1)]When s (i) is 1; when x () i (∈, Q)i Qi+st]ep2, s (i) i +1{ i ═ 1,2,3 }; when x (i) epsilon (Q)4,Q4+step3],s(i)=5;

Step 2.2.4: extracting Markov characteristics:whereinIn order to be the number of state upshifts,number of state downshifts, kiThe number of state holding times, s (j) is the state at time j, s (j +1) is the state at time j +1, and L represents the length of the data segment in the window. Converting the transition time matrix of each state obtained by the previous step into a one-dimensional row vectorBy passingObtaining a state transition probability matrix; where K is the corresponding state transition times matrix, K[i][j]The number of transitions from state i to state j;

and step 3: establishment and classification recognition of CNN model

Fig. 2 is a diagram showing a basic structure of the CNN model of the present invention. The Convolutional Neural Network (CNN) is a neural network created according to the visual cell research inspiration, and has the advantages that pictures and matrixes can be used as network input, the characteristic and sensitive information in the network input can be mined in an adaptive mode, and the convolutional neural network is the most different from a standard neural network in that each unit of the convolutional neural network is a two-dimensional or even high-dimensional convolution kernel, and the convolution kernel performs convolution operation on the input of the layer.

Fig. 3 shows a structure diagram of the VGG16 model according to the present invention. VGG16 is a 16-layer CNN network with 13 convolutional layers and 3 fully-connected layers, the convolutional layers using continuous convolutional kernels instead of larger convolutional kernels. The method has the advantages of not only enhancing the nonlinearity of the model, but also increasing the depth of the neural network, ensuring the learning of more complex signal characteristics, removing redundant parameter variables and improving the network convergence speed.

In the invention, a VGG16 model is selected as a basic structure of a CNN model, an input layer of the VGG16 model is improved, a sample set A, B, C is used as an initial input sample set, and an output sample set X is obtained through classification and identification of the CNN modeli=[Xi1;Xi2;…Xig…;XiM](ii) a i is a specific working condition type; randomly selecting n original data sample sets Xi=[Xi1;Xi2;…Xig…;XiM](ii) a Taking 80% of the CNN as a training sample set, and obtaining a training error of the CNN model through training; optimizing network parameters of the CNN model; in this embodiment, the identified operating condition category is a second category, that is, i is 2;

step 3.1: establishing a CNN model: selecting a VGG16 model as a basic structure for classification and identification of the pipeline vibration signal; the input structure is 224 × 224 × 3, the improved input layer is still three channels, and the object is identified as the sample set A, B, C.

Fig. 4 is a flow chart of the multi-channel CNN pipeline vibration signal identification method according to the present invention. In the invention, classification and identification are carried out based on a CNN model, and a data sample set is subjected to wavelet packet function noise reduction and feature extractionAs input, the convolution kernel in the convolution layer performs convolution operation on the features input to the layer; then the data is subjected to down-sampling processing by the pooling layer; then, the ReLU activation function is selected as the nonlinear activation function layer to connect the re-convolution layer and the full-connection layer, and the network parameters are adjusted according to the training error to obtain the output Xi=[Xi1;Xi2;…Xig…;XiM](ii) a In this embodiment, t is 72 and i is 2.

The specific steps of the classification and identification based on the CNN model are as follows:

step 3.2: classification recognition based on the CNN model:

step 3.2.1: raw data sample set When the input layer is connected to the convolution layer, the convolution kernel in the convolution layer checks the characteristics input to the layer and carries out convolution operation according to the size and the step length of the convolution kernel;Loutfor the input size of the current convolutional layer, LinInputting the size of the current layer, wherein K is the convolution kernel size of the current convolution layer, and S is the convolution step length of the previous layer; the mathematical formula for performing convolution operation on the input of the current layer by the convolution kernel is For the current convolutional layer input, kijWeight matrix for the current convolutional layer, bjIs the bias term vector of the current convolutional layer, fcov() In order to perform the convolution operation,is the output after the current convolution layer operation.

Step 3.2.2: : the data sample set is from the convolution layer to the pooling layer, and the pooling layer carries out down-sampling processing on the data; selecting a ReLU activation function frelu(x) Connecting the re-convolution layer and the full-link layer as a nonlinear activation function layer max (0, x); is the input of the full connection layer,for full link layer output, wijAs a weight matrix between the input and output of the full connection layer, bjIn order to be a vector of bias terms,is an activation function.

As shown in fig. 5 and 6, the comparison graphs of the training speed and the recognition rate of the pipeline vibration signal based on the multi-channel CNN and the original signal CNN in the present embodiment are shown. The CNN curve of a plurality of channels in the graph corresponds to a CNN model with three-channel signal characteristics, the CNN curve of a single channel corresponds to a CNN model with original vibration signals of a pipeline as input, and as can be seen from the graph, the CNN curve of a plurality of channels corresponds to a CNN model with three-channel characteristic input, so that the accuracy rate is low in the initial stage of training, but the accuracy rate of the two models reaches 90% after 7-8 rounds of iteration, and the convergence speed difference of the two models is not large. After 30 iterations, it can be seen that the two models tend to converge, with accuracy rates of 96.01% and 93.28%, respectively, and loss values of 0.128 and 0.189. It can be seen that inputting the pipeline vibration signal features into the network can achieve a higher recognition rate and lower loss than the original pipeline vibration signal that has not undergone feature extraction.

Step 3.2.3: using a loss function L (p, y) ═ Σ yn log(pn),n∈[1,N]To calculate the difference between the estimated output and the authentic tag,y is the real label output, p is the probability of all output categories, and N is the number of neurons in the output layer. Using Softmax functionThe probability of each class is calculated and,outputting the result for the previous non-normalization in the network; in optimizing convolutional neural network parameters using a cross entropy loss function KL (p/, y) L (p, y) -H (p), where KL (p/, y) is to minimize KL divergence between prediction output p and real label y, and L (p, y), H (p) are cross entropy L and entropy H of minimization of prediction output p and real label y, respectively.

FIG. 7 is a diagram showing the structure of the RNN model of the present invention. The Recurrent Neural Network (RNN) can generate memory states for past data, linking the data in the time dimension. Data input before the RNN all can influence subsequent input, and the interconnection between RNN internal neurons is more sensitive to the change of input signals in the time sequence entropy, and is more favorable to extracting the time sequence characteristic of pipeline vibration signals.

FIG. 8 shows a network structure for precisely identifying the ball-passing time of the Bi-LSTM-based in-pipeline detector of the present invention; the LSTM can memorize and learn the input of long-time sequences, can well mine the characteristics of the time sequences, and simultaneously supports the input of a plurality of parallel sequences.

And 4, step 4: RNN model establishment and regression prediction: constructing a many-to-one mode of an RNN model, and establishing a Bi-LSTM-based network structure for accurately identifying the ball-passing time of the in-pipeline detector; collecting the above samples Xi=[Xi1;Xi2;…Xig…;XiM](ii) a (ii) a Instead, it is changed intoAs sample input for RNN model; wherein i is a specific working condition type, and sxm is M; using a Mean Square Error (MSE) model; obtaining a network training error; constructing a Dropout model and a BN model, and optimizing network parameters of the RNN model; will be trainedThe RNN prediction algorithm performs regression prediction on the ball passing time of the detector in the pipeline;

as shown in fig. 9, a flow chart for predicting the precise identification of the ball-passing time of the RNN-based in-pipeline detector of the present invention includes the following specific steps:

step 4.1: establishing an RNN model: inputting the constructed RNN model into an s multiplied by m matrix; collecting the sampless × M ═ M as a sample input of RNN model; let the input at time t be x(t)Hidden state is h(t)。h(t)=σ(Ux(t)+Wh(t-1)+ b), σ is the hidden layer activation function, U is the cyclic node input weight, W is the state weight, b is the hidden layer bias. h is(t)From x(t)And hidden state h at time t-1(t-1)Obtain the output at time t as y(t)The calculation formula is as follows: y is(t)=λ(Vh(t)+ c), λ is the activation function of the output layer, V is the output layer node weight, and c is the output layer bias. In this embodiment, the characteristic dimension s is 576, and the time step m is 9.

Step 4.2: using mean square errorTo perform a calculation of a loss function, yiIs the predicted output of the RNN and,m is the number of samples for a true time stamp.

And 5: positioning and identifying of the detector in the pipeline: constructing a classification network based on CNN and a regression network based on RNN; randomly selecting n original data sample sets Xi=[Xi1;Xi2;…Xig…;XiM]80% of the training samples are used as a training sample set, and the parts are used as a test sample set; and carrying out positioning identification on the detector in the pipeline.

As shown in table 1, the method of the neural network in this embodiment and other conventional methods utilize SVM models, KNN models, and decision trees to identify accuracy data of the pipeline vibration signals. As can be seen from table 1, the CNN of the multi-channel feature input can very well manage the classification and identification of the pipeline vibration signals, the accuracy rate reaches 96.0%, the classification effect of the CNN of the channel feature input is obviously better than that of the other three classification methods, and the goal of the first stage of accurate ball-passing identification of the detector in the pipeline can be achieved.

TABLE 1

As shown in table 2, the traditional machine learning model support vector machine regression (SVR) and gaussian regression are adopted for comparison with Bi-LSTM and LSTM in this embodiment, and the Mean Absolute Error (MAE), Mean Square Error (MSE) and R-square are adopted as evaluation indexes of each model. The smaller the MAE index and the MSE index are, the better the prediction effect of the model is, the value of the R-square is between 0 and 1, and the closer the value is to 1, the closer the prediction is to the reality, and the better the fitting degree is. From Table 2, it can be seen that the MAE and MSE indexes of the Bi-LSTM model are significantly smaller than those of the conventional machine learning model, while the R-side index is closer to 1. The Bi-LSTM is proved to be superior to other models in the aspect of accurate prediction of the ball-passing time of the detector in the pipeline, and the prediction effect is more accurate and stable.

TABLE 2

The above-mentioned embodiments are only for illustrating the technical ideas and features of the present invention, and the purpose thereof is to enable those skilled in the art to understand the contents of the present invention and to carry out the same, and the present invention shall not be limited to the embodiments, i.e. the equivalent changes or modifications made within the spirit of the present invention shall fall within the scope of the present invention.

21页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种铝基隐身涂层损伤的超声波检测方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!