A fault diagnosis method for buried pipeline cathodic protection system based on convolutional neural network
Through the fault diagnosis method based on convolutional neural network, the problems of low fault diagnosis efficiency and poor accuracy in the cathode protection system of buried pipelines are solved, and the fault identification and prevention with high accuracy is achieved, which is in line with the digitalization and intelligence of the modern pipeline industry. trend.
Patent Information
- Application Number
- CN202011481130.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-16
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2040-12-16
AI Technical Summary
The existing fault diagnosis methods are inefficient, poor accuracy and untimely identification of artificial results in buried pipeline cathode protection systems, making it difficult to meet the high-demand diagnosis needs.
Using a fault diagnosis method based on convolutional neural network, the fault diagnosis model is constructed and trained by collecting and preprocessing historical running data, real-time running data is used for diagnosis, and data is constructed in combination with missing value processing, normalization and time-frequency domain feature maps. , using convolution, pooling and fully connected layers to extract feature information, and finally fail judgment is performed through the softmax classifier.
It improves the accuracy of fault diagnosis identification, reduces the workload of staff, can make timely judgments, prevent faults from occurring in advance, and is in line with the trend of digitalization and intelligence of pipeline systems.
Smart Images

Figure CN112508429B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of system fault diagnosis, and in particular to a method for diagnosing faults in a buried pipeline cathodic protection system based on a convolutional neural network. Background Art
[0002] Modern industrial systems are becoming increasingly large and complex, and the operational status of these facilities is closely linked to the economic performance of enterprises. This increasing complexity of production facilities presents a series of challenges in fault diagnosis and early prediction of industrial equipment failures. Failures in large systems can have serious consequences, threatening human life and property damage. However, fault diagnosis technology can often quickly identify the fault type within a short timeframe, even predicting its occurrence in advance and guiding personnel to promptly address and repair the problem.
[0003] The occurrence of system failures is related to many factors. First, it depends on the various properties of the system operation. Second, the occurrence of failures is often a gradual process. Symptoms often appear before the failure occurs. The current failure is the result of the accumulation of symptoms, that is, system failures have a time delay.
[0004] For buried pipeline cathodic protection systems, national standards require a 100% cathodic protection rate and a 98% effectiveness rate for potentiostats. Existing diagnostic technologies require high levels of expertise from pipeline operators and maintenance personnel, who often fail to meet these requirements due to their limited technical expertise. Furthermore, hiring professional technicians for on-site inspections often results in time delays, potentially leading to serious consequences and high costs.
[0005] Fault diagnosis can be divided into qualitative and quantitative analysis methods. Traditional fault diagnosis methods often focus on individual devices, subsystems, or subunits, making it difficult to identify the relationships between these components, which can easily lead to misdiagnosis and missed diagnoses. In recent years, intelligent fault diagnosis methods based on convolutional neural networks, exemplified by deep learning, have been widely applied in large wind turbines, rolling bearings, and aerospace equipment, bringing significant improvements and new insights to fault diagnosis. Summary of the Invention
[0006] The technical problem to be solved by the present invention is: in order to overcome the shortcomings of the existing technology, the present invention provides a buried pipeline cathodic protection system fault diagnosis method based on convolutional neural network, so as to solve the problems of low efficiency, poor accuracy and untimely human judgment results in the existing fault diagnosis method.
[0007] The present invention solves the technical problem by adopting a technical solution: a method for diagnosing faults in a buried pipeline cathodic protection system based on a convolutional neural network, comprising the following steps:
[0008] S1. Collect historical operating data of the cathodic protection system and perform data preprocessing;
[0009] S2. Divide the preprocessed historical operation data into training data and test data;
[0010] S3. Constructing a fault diagnosis model based on a convolutional neural network, and training the constructed fault diagnosis model using training data to obtain a trained fault diagnosis model;
[0011] S4. Use test data to test and evaluate the trained fault diagnosis model;
[0012] S5. If the test data has a good test effect and the model converges, the final fault diagnosis model is obtained; if the test effect is not good and the model has not converged, the hyperparameters of the model are adjusted until the model converges to obtain the final fault diagnosis model;
[0013] S6. Collecting real-time operation data of the cathodic protection system and performing data preprocessing;
[0014] S7. The processed real-time operation data is brought into the final fault diagnosis model for fault diagnosis to obtain a diagnosis result.
[0015] The data preprocessing method in step S1 and step S6 is the same, including the following three steps:
[0016] (1) Process missing values for the collected historical operation data and real-time operation data;
[0017] (2) Normalize the historical operation data and real-time operation data after filling in missing values;
[0018] (3) The normalized historical operation data and real-time operation data are constructed into time-frequency domain feature maps.
[0019] Through step (1), the problem of missing data can be supplemented, thereby ensuring the integrity of the input data; through step (2), the influence of different dimensions between different data can be eliminated, thereby improving the accuracy and convergence speed of fault diagnosis; through step (3), the data can better meet the input form of the CNN network, facilitating subsequent convolution, pooling and other operations and fully mining the input features.
[0020] Preferably, in step (1), the missing values are processed by the mean interpolation method, which can ensure that the integrity of the data is not damaged to a certain extent.
[0021] Preferably, in step (2), the data is normalized using the Z-score normalization method to map the result to the range [0, 1], and the function is:
[0022]
[0023] Among them, x i ' is the new data after normalization, and x var are the mean and standard deviation of similar data respectively.
[0024] Preferably, in step (3), the converted input layer is an 8×8 2D feature map, the horizontal direction is the measurement time interval, which is one day; the vertical direction is the data collected by the buried pipeline cathodic protection system.
[0025] Furthermore, the fault diagnosis model in step S3 includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, a softmax classification layer and an output layer connected in sequence, wherein:
[0026] An input layer, used to input the feature map;
[0027] A convolution layer performs a convolution operation on the feature map to extract feature information of the feature map;
[0028] A pooling layer, performing a pooling operation on the feature map to retain one of the feature information having a similarity value greater than or equal to a preset threshold;
[0029] Fully connected layer, used to integrate feature information;
[0030] A softmax classification layer, used to classify the feature information;
[0031] The output layer is used to output classification diagnosis results.
[0032] Specifically, the fault diagnosis model includes an input layer, 8 convolutional layers, 8 pooling layers, a fully connected layer, a softmax classification layer and an output layer connected in sequence. Each convolutional layer is connected to a pooling layer. The size of the convolution kernel of the convolutional layer is 3×3, the activation function used by the convolutional layer is the Relu function, and the activation function of the fully connected layer is the Tanh function.
[0033] The convolution formula used in the convolution layer of the fault diagnosis model is:
[0034]
[0035] Among them, l represents the number of layers in the network, k represents the convolution kernel, and b represents the bias. represents the output of layer l, represents the input of layer l, and f is the activation function of the convolutional layer.
[0036] The pooling method of the pooling layer is maximum pooling with a stride of 2.
[0037] In this invention, the model uses the error back propagation method to train the convolutional neural network, that is, through continuous iteration, the model objective function converges to the minimum to obtain the optimal weights and biases. The objective function of the model uses the cross entropy loss function, which is defined as:
[0038]
[0039] Where y i For the input sample x i The corresponding expected output, N is the number of training samples, F(x) is the input sample x i The corresponding actual model output, the classification function F(x) is the Softmax classification function.
[0040] In step S5, the constructed convolutional neural network is verified and evaluated using test data. If the evaluation accuracy is low, it is necessary to repeatedly verify by adjusting the hyperparameters until the model converges and the fault diagnosis accuracy reaches the ideal effect. The adjustable hyperparameters include learning rate, number of iterations, batch size, activation function, number of hidden layers and units, weight initialization and random inactivation.
[0041] The selection of the above hyperparameters requires continuous debugging to select the combination with the best diagnostic effect. The input of the present invention is an 8×8 2D feature map. The vertical direction is the automatically collected data including rated voltage, rated current, output voltage, output current, control potential, protection potential and protection potential at the test pile; the horizontal direction is different collected data with an interval of one day. The output is divided into seven different types: constant potential instrument itself failure, reference electrode failure, failure caused by stray current, cable failure, excessive anode grounding resistance, anti-corrosion layer damage and normal fault-free.
[0042] In step S7, the real-time operation data is processed and then transmitted to the final fault diagnosis model, and the fault type is finally determined by the softmax classifier.
[0043] The present invention adopts the CNN model for fault diagnosis. CNN can perform convolution and pooling on the input data layer by layer through convolution kernels, and extract the topological structure features hidden in the data step by step, avoiding the defects caused by manual extraction. As the network structure goes deeper layer by layer, the extracted features become more abstract, and finally a feature representation of the input data that is invariant to translation, rotation and scaling is obtained. The weight sharing feature of CNN can effectively avoid overfitting of the algorithm, and the use of downsampling in space or time can reduce the number of training parameters. Subsampling makes full use of the local characteristics of the data itself, reduces the data dimension, optimizes the network structure, and significantly improves the accuracy and noise resistance of the model.
[0044] The beneficial effects of the present invention are as follows: The present invention establishes a fault diagnosis model for buried pipeline cathodic protection systems based on a convolutional neural network, which can effectively extract feature information in the attribute dimension and delay information in the time dimension, thereby improving the recognition accuracy of fault diagnosis. By using deep learning methods to perform fault diagnosis on buried pipeline cathodic protection systems, not only is the workload of staff reduced, but timely judgments can be made and repairs completed as soon as possible; at the same time, the likelihood of fault occurrence can be reflected to a certain extent, thereby preventing the occurrence of faults in advance; and the fault identification model can also be appropriately modified according to the actual operation of the buried pipeline cathodic protection system, thereby achieving the effect of autonomously identifying new faults, which is in line with the trend of digitalization and intelligentization of pipeline systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The present invention will be further described below with reference to the accompanying drawings and examples.
[0046] Figure 1 It is a flow chart of the fault diagnosis model of the present invention.
[0047] Figure 2 It is the 2D feature map used as CNN input after the original data is processed in the present invention.
[0048] Figure 3 It is a schematic diagram of the forward and reverse propagation process of training CNN in the present invention.
[0049] Figure 4 It is a schematic diagram of the network structure of the fault diagnosis model based on CNN of the present invention. DETAILED DESCRIPTION
[0050] The present invention will now be described in further detail with reference to the accompanying drawings, which are simplified schematic diagrams that illustrate the basic structure of the present invention in a schematic manner.
[0051] like Figure 1 The method for fault diagnosis of buried pipeline cathodic protection system based on convolutional neural network has the following steps:
[0052] S1. Collect historical operating data of the cathodic protection system, including rated parameters and output values of the constant potentiostat, protection potential at the test pile, and perform data preprocessing;
[0053] S2: Divide the processed historical running data into training data and test data;
[0054] S3: Use the training data to build a fault diagnosis model and perform training;
[0055] S4: Use test data to test and evaluate the trained fault diagnosis model;
[0056] S5: If the test data has a good test effect and the model converges, the final fault diagnosis model is obtained. If the test effect is not good and the model has not converged, the model hyperparameters are adjusted until the model converges to obtain the final fault diagnosis model.
[0057] S6: Collect the real-time operation data of the cathodic protection system and perform data preprocessing;
[0058] S7: The processed real-time operation data is brought into the final fault diagnosis model for fault diagnosis to obtain a diagnosis result.
[0059] The data preprocessing method described in step S1 and step S6 is the same and includes the following three steps:
[0060] (1) Process missing values for the collected historical operation data and real-time operation data;
[0061] (2) Normalize the historical operation data and real-time operation data after filling in missing values
[0062] (3) The normalized historical operation data and real-time operation data are constructed into time-frequency domain feature maps that can be used as original input.
[0063] The generation of missing values in step (1) can be divided into mechanical reasons and human reasons. Mechanical reasons are data missing due to failure in data collection or storage caused by mechanical reasons, such as data storage failure, memory damage, and mechanical failure resulting in data not being collected for a certain period of time. Human reasons are data missing due to subjective errors, historical limitations, or intentional concealment.
[0064] Missing values are classified by type as missing completely at random, missing at random, and missing completely non-random. Treatment methods include deleting cases with missing values and interpolating missing values with probable values. Interpolation methods are further categorized into four types: mean interpolation, homogeneous mean interpolation, maximum likelihood estimation, and multiple interpolation. Most missing values in buried pipeline cathodic protection systems are missing completely at random. Deleting cases with missing values would destroy the temporal properties of the data. To ensure that the temporal properties of the original data are not destroyed, this embodiment uses mean interpolation to handle missing values.
[0065] In step (2), data normalization uses deviation normalization to eliminate the influence between different dimensions, avoid the problems of "gradient vanishing" and "gradient exploding", and improve the accuracy of diagnosis. The Z-score normalization formula is as follows:
[0066]
[0067] Type, x′ i is the new data after normalization, and x var are the mean and standard deviation of similar data respectively.
[0068] In step (3), the historical operation data and the real-time operation data are transformed into the following after missing value processing and normalization: Figure 2 The 2D feature map shown in the figure has an input data dimension of 8×8 and the data categories are as follows: Figure 2 As shown in the figure, the horizontal axis represents the daily data collection interval, while the vertical axis represents the rated voltage, rated current, output voltage, output current, control potential, protection potential, and protection potential at the test pile. The data output consists of seven neurons representing seven fault types. An activation value of 1 in the output layer neuron indicates that the input data corresponds to that fault type. Therefore, a coding table for the fault types can be created, as shown in Table 1 below.
[0069] Table 1 Fault type code
[0070]
[0071] Steps S3 to S5 are for training and adjusting the convolutional neural network. The training of CNN and its forward and reverse propagation processes are as follows: Figure 3 As shown in the figure, CNN is divided into forward propagation and back propagation. During the forward propagation process, the convolution layer performs convolution operations on the previous layer of the network. Each convolution kernel extracts a feature. The calculation formula is:
[0072]
[0073] In the formula, l represents the number of layers in the network, k represents the convolution kernel, and b represents the bias. represents the output of layer l, Represents the input of layer l, and f is the activation function of the convolutional layer. The convolutional layer in CNN has the characteristic of weight sharing, which can effectively avoid overfitting of the algorithm. The pooling layer can reduce the dimension of the data by downsampling and can ensure a certain degree of displacement invariance. The CNN fault diagnosis model uses the error back propagation method to train the convolutional neural network, that is, through continuous iteration, the model objective function converges to the minimum and obtains the optimal weight and bias. The loss function of the model is the cross entropy loss function, and its formula is:
[0074]
[0075] Where y i For the input sample x i The corresponding expected output, F(x) is the input sample x i The corresponding actual model output, the classification function F(x) is the Softmax function, and its formula is
[0076] When using test data to evaluate a CNN fault diagnosis model built with initial settings, the model may not converge, and the diagnostic accuracy may not meet the required standards. In this case, it is necessary to adjust the model's hyperparameters to obtain the optimal CNN fault diagnosis model. Adjustable hyperparameters include the learning rate, number of iterations, batch size, activation function, number of hidden layers and units, and weight initialization.
[0077] To avoid skipping the optimal solution due to a large learning rate and slow convergence due to a small learning rate, an exponentially decaying learning rate is used here. A large learning rate is used first to quickly obtain a better solution, and then the learning rate is gradually reduced to stabilize the model in the later stages of training.
[0078] In terms of convolution kernel size, after comparison and verification, compared with the convolution kernel size of 5×5, the training set accuracy is higher when the convolution kernel size is 3×3; in terms of the number of convolution kernels, as the number of convolution kernels increases, the accuracy is also improving, but the training time is also greatly increased. When the number of convolution kernels reaches 8, as the number increases, the accuracy improves very little and the training time increases sharply. Therefore, in the present invention, the convolution kernel size adopts the form of 3×3, and the number is 8.
[0079] Most pooling methods of the pooling layer in CNN use mean pooling or maximum pooling. In the buried pipeline cathodic protection system, more emphasis is placed on the maximum feature of the data rather than the position feature. Maximum pooling can reduce noise interference and improve the robustness of the model. Therefore, in this embodiment, the pooling method selected is maximum pooling.
[0080] Since the activation function has a great influence on the training of CNN network, the selection of activation function is usually based on experience, which has great limitations. The common activation functions in CNN are Sigmoid function, and the formula is Relu function, the formula is f(x)=max(0,x); Tanh function, the formula is In this example, a total of 615 data sets were collected from cathodic protection systems for oil and gas pipelines in various regions. 430 sets of data were randomly selected for training, and 185 sets were used for testing. Experiments compared the accuracy of the models using three different activation functions, as shown in Table 2. The experimental results show that the ReLU function is suitable for convolutional layer activation, while the Tanh function is suitable for fully connected layer activation.
[0081] Table 2 Activation function performance data table
[0082]
[0083] The final model network structure diagram is as follows Figure 4As shown, there are three hidden layers, with 8 convolution kernels of 3×3 size. The pooling layer uses a max-pooling connection method. The fully connected layer is connected to each input of the pooling layer and has 16 units, with a total of (3×3×8+1)×16=1168 parameters. Finally, it is fully connected to the output layer and passes through the Softmax classifier to determine the specific fault type.
[0084] Traditionally, fault diagnosis for buried pipeline cathodic protection systems requires a series of on-site inspections and verifications to determine the fault type. This is not only time-consuming and labor-intensive, but also prone to failures and potential consequences during the gaps in testing. Experiments have shown that using convolutional neural networks for buried pipeline cathodic protection system fault diagnosis can fully exploit the variations in daily test data caused by faults, achieving a fault diagnosis accuracy of over 97%. This method has promising application prospects and aligns with the trend of digitalization and intelligentization in the modern pipeline industry.
[0085] With the above-described preferred embodiments of the present invention as a guide, and with reference to the above description, relevant personnel are fully capable of making various changes and modifications without departing from the technical scope of this invention. The technical scope of this invention is not limited to the contents of the specification and must be determined according to the scope of the claims.
Claims
1. A method for fault diagnosis of buried pipeline cathodic protection system based on convolutional neural network, characterized by: The following steps are involved: S1. Collect historical operation data of the cathodic protection system and perform data preprocessing; S2, dividing the preprocessed historical operation data into training data and test data; S3, constructing a fault diagnosis model based on a convolutional neural network, and training the constructed fault diagnosis model through training data to obtain a trained fault diagnosis model; The fault diagnosis model includes an input layer, a convolutional layer, a pooling layer, a fully connected layer, a softmax classification layer, and an output layer connected in sequence, where: Input layer, used to input feature maps; The convolution layer performs convolution operation on the feature map to extract the feature information of the feature map; The pooling layer performs a pooling operation on the feature map to retain one of the feature information whose similarity value is greater than or equal to a preset threshold; Fully connected layer, used to integrate feature information; A softmax classification layer, used to classify the feature information; Output layer, used to output classification diagnosis results; The transformed input layer is a 8×8 2D feature map, with the horizontal measurement time interval being one day, and the vertical measurement data collected by the buried pipeline cathodic protection system. The model uses the error back propagation method to train the convolutional neural network, that is, through continuous iteration, the model objective function converges to the minimum and obtains the optimal weight and bias; the model objective function uses the cross entropy loss function, which is defined as: In the formula, y i For the input sample x i The corresponding expected output, N is the number of training samples, F(x) is the input sample x i The corresponding actual model output, the classification function F(x) is the Softmax classification function; S4, using the test data to test and evaluate the trained fault diagnosis model; S5. If the test data has a good test effect and the model converges, the final fault diagnosis model is obtained; if the test effect is not good and the model has not converged, the hyperparameters of the model are adjusted until the model converges to obtain the final fault diagnosis model; When adjusting, the above hyperparameters are selected to have the best combination of diagnostic effects. The input is a 8×8 2D feature map. The vertical direction is the automatically collected data including rated voltage, rated current, output voltage, output current, control potential, protection potential and protection potential at the test pile; the horizontal direction is different collected data with an interval of one day; the output is divided into seven different types: constant potential instrument fault itself, reference electrode fault, fault caused by stray current, cable fault, excessive anode grounding resistance, anti-corrosion layer damage and normal without fault; S6. Collect the real-time operation data of the cathodic protection system and perform data preprocessing; S7, bringing the processed real-time operation data into the final fault diagnosis model to perform fault diagnosis and obtain a diagnosis result; The data preprocessing in steps S1 and S6 includes the following three steps: (1) The missing values of the collected historical operation data and real-time operation data are processed by using the mean interpolation method; (2) The historical operation data and real-time operation data after missing values are filled are normalized. The normalization adopts the Z-score normalization method to map the results to [0, 1]. The function is: Among them, x i ' is the new data after normalization, and x var are the mean and standard deviation of the same type of data respectively; (3) The normalized historical operation data and real-time operation data are constructed into a time-frequency domain feature map that is convenient for use as the input of the convolutional neural network. The horizontal direction of the time-frequency domain feature map is the measurement period interval, which is 1 day, and the vertical direction is the data collected by the buried pipeline cathodic protection system.
2. The method for fault diagnosis of buried pipeline cathodic protection system based on convolutional neural network according to claim 1, characterized in that: In step S3, the convolution formula for constructing and training the CNN network is: In the formula, l represents the number of layers in the network, k represents the convolution kernel, and b represents the bias. represents the output of layer l, represents the input of layer l, and f is the activation function of the convolutional layer.
3. The method for fault diagnosis of buried pipeline cathodic protection system based on convolutional neural network according to claim 1, characterized in that: In step S5, the constructed convolutional neural network is verified and evaluated using test data. If the evaluation accuracy is low, it is necessary to repeat the verification by adjusting the hyperparameters until the model converges and the fault diagnosis accuracy reaches the ideal effect. The adjustable hyperparameters include learning rate, number of iterations, activation function, number of hidden layers and units, and initialization of weights.
4. The method for fault diagnosis of buried pipeline cathodic protection system based on convolutional neural network according to claim 1, characterized in that: In the step S7, the real-time operation data is processed and then transmitted to the final fault diagnosis model, and finally the fault type is determined by the softmax classifier.