Fault Detection of Reciprocating Compressor Valve Based on One-Dimensional Convolutional Neural Network

Reciprocating compressors are important equipment in oil and gas industries which closely relate with the healthy development of the enterprise. It is essential to detect the valve fault because valve failures account for 60% in total failures. For this field, an artificial neural network (ANN) is widely used, but a complex network is not suitable for its low accuracy and easy overfitting.-is paper proposes a fault diagnosis model of a reciprocating compressor valve based on a one-dimensional convolutional neural network (1DCNN). -is method takes the differential pressure and differential temperature of each compressor stage as the input of 1DCNN, using the characteristics of the CNN to extract the features and finally using Softmax to classify the fault. In order to verify this method, it is compared with LM-BP, RBF, and BP neural networks. -e results show that the fault recognition rate of 1DCNN reaches 100%, which proves the effectiveness and feasibility of the proposed method.


Introduction
Reciprocating compressor is one of the most widely used compressor technologies in today's oil and gas industries. It can compress a variety of gases and has a wide range of applications, high compression efficiency, and stable working pressure. However, due to its complicated structure and many vulnerable parts, once a failure cannot be detected and eliminated in time, it will bring huge losses to the enterprise [1][2][3][4][5][6][7]. e literature indicates that 60% of reciprocating compressor failures are valve failures, and the number of shutdowns caused by valve failures accounted for 36% and accounted for 50% of the total maintenance costs [8][9][10]. erefore, monitoring the failure of the reciprocating compressor valve can not only reduce the overall maintenance cost but also improve the stability of the compressor operation.
Due to the characteristic of deep learning [11] which can overcome the shortcomings of traditional learning model networks such as complexity, low accuracy, and easy overfitting, it has quickly become a hot topic in the research field in the past few years. It has made breakthrough progress in image recognition, voice recognition, language processing, and other fields. In view of the achievements of deep learning in other fields, it has also received more and more attention in the fault diagnosis and intelligent identification of modern industrial machinery and equipment. Tran et al. [12] proposed a hybrid deep belief network. e hybrid algorithm was pretrained by the deep belief network, and the training results were classified by the SfAM. e single and combined faults of the suction and exhaust valves were diagnosed by acquiring the three signals of vibration, pressure, and current of the reciprocating compressor. Liu et al. [13] proposed an intelligent fault diagnosis method combining local mean decomposition (LMD) and stack noise reduction automatic encoder (SDAE) to classify faults of reciprocating compressor gas valves. e results show that the classification accuracy of this method can reach 92.72%. Zhao et al. [14] proposed a compound interpolation envelope LMD (CIE-LMD) algorithm to analyze the vibration signals of the reciprocating compressor in different states.
e results show that this method can effectively diagnose the fault of excessive bearing clearance of reciprocating compressors.
A convolutional neural network [15], as one of the classic algorithms in deep learning, is the first learning algorithm that can truly successfully train multilayer networks. Its special convolutional layer and pooling layer can effectively reduce the complexity of the network, greatly reduce the number of free parameters during training, and have strong robustness and fault tolerance. e entire network is easy to train and optimize. ese characteristics of convolutional neural networks have attracted a large number of scholars to study their theory and applications. Some experts have also tried to use convolutional neural networks to solve the problem of fault diagnosis. Yang et al. [16] used three sensors to collect vibration signals when the reciprocating compressor valve fails, and directly used as the input of the convolutional neural network to make full use of its characteristics that automatically extract characteristic signals, and then carried out fault diagnosis and obtained higher fault recognition rate. Ince et al. [17] used the one-dimensional motor current signal as the input of a convolutional neural network and then diagnosed the fault of the motor. e fault recognition rate is as high as 97.8%. Zhang et al. [18] extracted vibration signals during diesel engine fire faults, and automatically extracted fault features through one-dimensional convolutional neural networks, and then classified the faults. e results proved that the accuracy rate under different operating conditions can reach 100%.
At present, vibration signals are mostly used as sample data for fault diagnosis of reciprocating compressor valves. However, according to the thermal performance parameter fault diagnosis method of reciprocating compressors established by Qi [19], it is known that the most direct response of a gas valve when a leak occurs is the pressure ratio imbalance, and the temperature and pressure responses are the most obvious [20][21][22][23][24]. As mentioned earlier, the CNNs' ability to learn to extract the optimal features and the system can achieve the optimal fault classification and fault detection accuracy through proper training. erefore, this paper takes the differential pressure and differential temperature of each stage of the multistage reciprocating compressor as sample data. A fault diagnosis model of a reciprocating compressor valve based on one-dimensional convolutional neural network is established, the features in the sample data are automatically extracted, and then fault classification is performed by the Softmax function. e advantages of this method are (1) directly using the temperature signal and pressure signal can well achieve online fault diagnosis and improve the quality and efficiency of detection and (2) automatically extracting the fault characteristics of the reciprocating compressor valve through the model, without the need to manually extract the characteristics and selection, which improves the accuracy of fault diagnosis.

Structure and Principle of CNN
Convolutional neural networks are a typical type of deep neural networks. ey are supervised learning algorithms such as BP neural networks, so they need to be equipped with labeled data as training samples. e essence is to add multiple filters before the traditional fully connected network. e input data are convolved and pooled layer by layer to achieve the effect of extracting input features [25][26][27]. e biggest improvement of the convolutional neural network lies in the convolutional layer, which greatly reduces the number of parameters, so as to greatly reduce the calculation amount of the network.
A typical CNN topology is shown in Figure 1. e input of the network is a 2D feature map. After that, each convolution layer and pooling layer alternately appear, and the output of this layer is used as the input of the next layer, and so on. At the end of the CNN, several fully connected layers are generally used to link each neuron in the previous layer.
is process can expand the feature map into a one-dimensional vector for final classification.
CNN convolutional layers are used to extract local features from the input neuron data. Each type of convolution corresponds to an extracted feature. e same type of convolution kernel has the property of weight sharing, which can be learned in parallel and greatly reduces the free parameters. And the complexity of the network is reduced to a certain extent. e feature information extracted by each type of convolution kernel is limited, so multiple convolution kernels are generally used to extract feature information. e input of the convolutional neural network is X, and H l represents the feature maps (H 0 � X)of the lth layer, assuming that H l j is the jth feature map of the convolutional layer of the lth layer, and the process of H l j generation is as follows: where W (l) ij represents the weight matrix connecting the ith feature map of layers l − 1 and the jth feature map of the layer l; k represents the number of feature maps in layers l − 1; i and j are the indexes of the input and output feature maps; and b j l is the offset corresponding to each feature map of the layer l. Finally, the jth feature map H j l of the layer l is obtained by the excitation function f (·). e excitation function can be the ReLU function, sigmoid function, tanh (x) function, radial basis function, etc. e CNN pooling layer is also called the downsampling layer, and its role is to scale and map the data graph of the previous layer, so as to reduce the data dimension. Suppose H l j is the jth feature map of the lth pooling layer. e generation process is as shown in equation (2), where down (·) represents a pooling function, and each output feature map corresponds to its own multiplicative bias β l j and an additive bias b l j : High-level features are extracted by sequentially stacking convolutional layers and pooling layers, and these features are flattened into one-dimensional vectors. For example, the feature H P 2 j extracted from P 2 in Figure 1 is flattened into a one-dimensional feature vector which is the output of the fully connected layer F 1 . Similar to the multilayer neural network thereafter, the output of the F 2 layer is as follows: where H is an flattened one-dimensional vector; k represents the number of feature maps in the layer At present, convolutional neural networks are mostly a supervised deep learning model. Network training is similar to traditional artificial neural networks. In the fully connected layer, the back propagation algorithm (BP) is still used to optimize the parameters to reduce the error to the expected value. e parameters are optimized by the gradient descent method.

Test Rig and Instrumentation.
e experimental bench consists of a six-stage water-cooled reciprocating compressor and a synchronous motor of the type TK2800-20/ 2150, with a maximum speed of 300r/min. e compressor consists of six cylinders, the pressure of the suction gas is 1961.33 Pa (gauge pressure), and the final exhaust pressure after compression of each cylinder is 31.4 MPa (gauge pressure). When the multistage reciprocating compressor gas valve leaks, the hot gas will blow back into the cylinder.
is will not only heat the intake gas during the intake process but also continue to heat the gas at the beginning of the compression process, causing the exhaust temperature to rise. e change in temperature will cause the pressure to change, and the change in the previous stage will cause the pressure and heat to increase in the next stage of gas compression. Due to design reasons, the cooling device is fixed at the exhaust port of the cylinder, so the heat generated during the compression of the gas cannot be removed in time, which causes the volume of the gas to expand, the quality of the compressed gas to decrease, and ultimately the efficiency of the compressor to decline. In summary, when the valve leaks, the temperature and pressure of the gas entering and exiting the cylinder are directly affected. erefore, this experiment uses 12 pressure sensors and 12 temperature sensors to collect the temperature and pressure of the gas at the inlet and outlet of each cylinder. e sensor installation diagram is shown in Figure 2. In the figure, P 1 and T 1 represent the sensors for collecting gas pressure and temperature at the inlet of the cylinder I, P 2 and T 2 represent the sensors for collecting gas pressure and temperature at the outlet of the cylinder I, and the sensors required for other cylinders are installed similarly.

Experimental Procedure.
e experiment first obtains the data that are collected by all sensors when the valve of each cylinder is normal and then calculates the differential pressure and differential temperature between the inlet and outlet gases of each cylinder. For example, if the pressure and temperature of the inlet gas of the cylinder I are P 1 and T 1 and the pressure and temperature of the outlet gas are P 2 and T 2 , then the differential pressure and differential temperature between the inlet and outlet gases of the first-stage cylinder are P d1 and T d1 . Because it is a 6-stage reciprocating compressor, 12 numbers are obtained after all calculations. ese 12 numbers form a set of sample data. Table 1 shows the symbols of the differential pressure and differential temperature between the inlet and outlet gases of each cylinder. Next, the above experiments were repeated under the same operating conditions but simulated six types of real faults, first-stage valve leak, second-stage valve leak, thirdstage valve leak, fourth-stage valve leak, fifth-stage valve leak, and sixth-stage valve leak. Table 2 is the fault code table.

Established 1DCNN Fault Diagnosis Model
Unlike image data, temperature and pressure data are one dimensional, and it is more reasonable to use the one-dimensional convolutional CNN to process these data. In this paper, the feature extraction and fault diagnosis of reciprocating compressor valves are combined, and a one-dimensional convolutional neural network (1DCNN) model is proposed. As shown in Figure 3, the model uses the original temperature and pressure signals without the need for manual feature extraction. e classic VGG model replaces the convolution kernel size with 3 * 3 and the pooling kernel size with 2 * 2, which can greatly reduce the number of parameters and improve the accuracy of the model, while maintaining the spatial structure of the input of the previous layer. Because the input data of the model established in this paper are 12 * 1 (the 6-stage reciprocating compressor and the differential pressure and differential temperature between the gas inlet and outlet of each stage), the size of the convolution kernel in this model is set to 3 * 1 and the size of the pooling kernel is set to 2 * 1. e Keras framework is used  to construct a training model in Python. After several verifications and adjustments, the 1DCNN model for reciprocating compressor valve fault diagnosis uses the network structure shown in Table 3, including 2 convolutional layers, 2 maximum pooling layers, 1 flatten layer, and 2 fully connected layers whose length is 128 and 64, respectively. Finally, the Softmax function is used to classify the 7 faults in Table 2. In order to overcome the disappearance of gradients and speed up network training, the activation functions of each layer use the ReLU function. e 1DCNN model in this paper uses a multiclass crossentropy function to measure the Softmax classification results. p(x) represents the target class probability distribution, q(x) represents the predicted probability distribution, and p(x) and q(x) cross-entropy function formula is as follows: In order to minimize the loss function, this article uses the Adam algorithm proposed by Kingma et al. [28] to optimize the gradient descent method. Its advantage lies in the design of independent adaptive learning rates for different parameters when calculating the gradient, and basically only very few parameters need to be adjusted.  Figure 2: Experimental sensor installation diagram.   Figure 4. e differential pressure and differential temperature data of each stage of gas when a certain level of valve failure is collected are divided into a training set and a test set. e training set data are trained by the 1DCNN to perform forward and back propagation to minimize errors. e 1DCNN training model that meets the requirements uses the test set data for evaluation and verification.

Description of the Data Set.
rough the experimental process described in Section 3.2, a total of 2100 sets of sample data are obtained. Each set of data is 12 numbers representing the differential pressure and differential temperature between the inlet and outlet gases of each cylinder. Table 4 shows some sample data. According to the holdout method [29], the data are decomposed and recombined: 70% are used as training data, including 1470 data samples; 30% are used as test samples, including 630 data samples. e training samples are used for model establishment, and the test samples are used for model evaluation.

Experimental Results and Discussion
. 70% of the sample data are randomly selected as the input for network training, and the parameters are adjusted and updated after forward and back propagation. e remaining 30% of the sample data are used to test the fault recognition performance of the trained model, and the accuracy curve and loss curve are shown in Figure 5. e red dashed line in the loss curve represents that the set error is 1e −5 . In order to prevent the random factors from affecting the training results, 10 experiments are repeated. e results are shown in Figure 6. e accuracy of each diagnosis is stable at 100%. e comparison methods include the Levenberg-Marquardt neural network (LM-BP), radical basis function neural network (RBF), and conventional BP neural network [30]. Statistics and analysis of the training results are shown in Table 5, and Figure 7 is a comparison of the results of the fault diagnosis test. When using the 1DCNN model for training, the required error is reached when the number of iterations reaches 23, the average test error is 0.0001, and the test accuracy rate reaches the highest level of 100%. LM-BP achieves the required error after 87 iterations.
e test error and test accuracy are slightly lower than the Input layer 12 * 1 Feature map X (4) Feature map X (3) Feature map X (2) Feature map X (1)    Obtained data on the differential pressure and differential temperature of each stage of the compressor   In order to further verify the diagnostic performance of the 1DCNN model, the proportion of training samples and test samples in the data is adjusted, and the proportions of training samples are set to 70%, 50%, and 30%. e best three sets of results are selected from the training results of these three sample sets, and the loss curve and accuracy curve of the three sets of training results are compared, as shown in Figure 8. e results show that, whether it is a loss curve or an accuracy curve, 70% of the training data converge the fastest, followed by 50% of the training data, and 30% of the training data are the slowest.

Visualization of Learning Features.
e advantage of 1DCNN is that it can automatically extract the features of the sample data for training. In order to verify the feature extraction capability of this model, the t-distributed stochastic neighbor embedding (t-SNE) method is used to reduce the high-dimensional data to two-dimensional data and visualize. Because the output layer of the 1DCNN model is Softmax classification, the fully connected layer of the previous layer is used as the sample feature extracted by the model, and the 64-dimensional feature is reduced to twodimensional feature and visualized by the t-SNE method. Figure 9 shows a visualization of the features extracted using the 1DCNN model. e colored numbers in the figure correspond to the fault numbers in Table 2. It is obvious that each fault condition is well aggregated, and the different characteristics are effectively separated. e above results show that the 1DCNN model has excellent feature extraction capabilities and can adaptively extract features required for fault diagnosis.

Conclusions
is paper proposes a one-dimensional convolutional neural network-based fault diagnosis method for reciprocating a compressor gas valve. Two types of data such as the differential pressure and differential temperature between each stage of a multistage reciprocating compressor are tested. And compared with the fault classification results of BP neural network, RBF neural network, and LM-BP neural network, the experimental results show that the fault recognition rate of the BP neural network reaches 89.72%, and the test error is 0.064; the fault recognition rate of the RBF neural network is 92.25%, and the test error is 0.005; the fault recognition rate of the LM-BP neural network is 96.78%, and the test error is stable at 0.001; and the 1DCNN fault recognition rate reaches 100%, and the test error is stable at 0.0001. By comparison, it is concluded that the accuracy of the 1DCNN is higher, which can effectively monitor the operating conditions of the reciprocating compressor valve, thereby reducing or even avoiding accidents. At present, when establishing a model in this paper, it is necessary to continuously adjust the parameters manually. In the future, I hope that a universal model can appear.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.