A Novel Improved Local Binary Pattern and Its Application to the Fault Diagnosis of Diesel Engine

Aiming at the feature extraction diﬃculty of vibration signals, an improved local binary pattern-(ILBP-) based diesel engine fault diagnosis approach is proposed. To eﬀectively make use of the component spatial information in time-frequency images, local binary pattern (LBP) algorithm is applied. Also, in view of the problems that traditional LBP coding is easily interfered by singular pixel points and the relative spatial information is not prominent, an improved coding rule of the LBP operator is put forward in this paper. Compared with some typical LBP algorithms, computational complexity of the proposed ILBP algorithm is greatly reduced, and the coding sparsity is greatly improved. The ILBP operator is applied to fault diagnosis of BF4L1011F diesel engine with eight diﬀerent valve conditions. For comparison, six kinds of time-frequency distribution are used to convert raw vibration signals into time-frequency images, and then circular LBP, rotation-invariant LBP, uniform LBP, and ILBP operator are applied for texture coding. Finally, nearest neighbor classiﬁer (NNC) and support vector machine (SVM) are used for fault identiﬁcation. The classiﬁcation results show that the ILBP operator proposed in this paper can better describe the texture feature information in vibration time-frequency images of the diesel engine, and a good diagnostic eﬀect can be achieved by combining wavelet packet (WP) distribution and ILBP.


Introduction
Abnormal valve clearance and leakage are very easy to happen since the valve mechanism always works under high temperature and high-speed airflow, which greatly affects normal operation of diesel engine [1,2].
is kind of failure may change the timing of valve opening and closing, affect the air quality in the cylinder, and even lead to combustion deterioration. In order to effectively identify the failure, a common practice is vibration signal analysis based condition monitoring. Vibration signal of diesel engine is a typical nonstationary time-varying signal, which contains abundant characteristic information and can be used to directly, quickly, and accurately reflect the running state of diesel engine. So, how to extract and analyse the characteristic information of vibration signals is always the hotspot of diesel engine fault diagnosis [3,4].
Analysis of the stationary quantities in some cases finds it difficult to detect faults via either pure time-domain or frequency-domain signal processing methods. erefore, due to the time-varying frequency spectrum of transient signals, suitable time-frequency analysis tools are needed for realtime monitoring and fault diagnosis. Time-frequency analysis can identify the signal frequency components and reveal their time-variant features, which has been an effective tool for monitoring and fault diagnosis by extracting feature information contained in nonstationary signals [5,6]. In recent years, researchers have introduced image processing technology into the field of diesel engine fault diagnosis, using signal time spectrum maps for image feature extraction and classification recognition. Wang et al. [7] use the Wigner-Ville distributions (WVD) of vibration acceleration signals and probabilistic neural networks (PNN) to identify the failure of diesel valve train; He et al. [8] proposed a novel denoising method for reliable machinery fault diagnosis based on timefrequency analysis and manifold learning; Zhao et al. [9] analysed the local wave time-frequency method and applied it to the analysis of diesel engine vibration signals; Liu et al. [10] proposed a fault diagnosis approach for diesel engines based on self-adaptive WVD, fast correlation-based filter, and relevance vector machine. e above methods have greatly promoted the development of fault diagnosis technology of diesel engine, but there are still many ways to explore.
Statistical methods are widely used in texture feature extraction of time-frequency images; the most representative of them is grey level cooccurrence matrix (GLCM) method [11]. GLCM can export 14 feature quantities to describe the texture feature information of images. However, to calculate all the texture feature quantities, the computation of GLCM required is quite large, which also limits its application in texture feature extraction of highdimensional images. Aiming at this problem, Ulaby et al. [12] put forward the fact that the texture features of images can be reflected by only four feature quantities since the 14 feature quantities in GLCM are strongly correlated. But the improved method often requires large manual intervention to screen the parameters, and inappropriate feature selection may result in losing of grey space dependence information in images. In recent years, the local binary mode (LBP) algorithm proposed by Ojala et al. [13] has become more and more widely used. It has small computational complexity and shows great advantage when applied to texture retrieval in some cases. e LBP operator can describe the relative relationship of grey values in images and owns grey-scale translation invariance property within a certain range. Further, Mäenpää and Pietikäinen [14] improved the LBP operator and proposed a rotation-invariant LBP operator to eliminate the influence of image rotation. e rotation-invariant LBP operator guarantees the rotation invariance of the code, but it may be not suitable for analysis of the vibration time-frequency images since the horizontal and vertical coordinates in the images are strictly corresponding and have different physical meanings. Ojala et al. [15] also proposed a preferred uniform LBP operator for binary code values. When the binary pattern generated by the LBP operator jumps from 0 to 1 no more than twice, the mode is defined as uniform mode. e uniform mode LBP operator with sampling points can obtain the most coded values, and the current code value is reduced from the original 256 to 59. However, the grey-scale difference between the central pixel and neighbouring pixels in local area is not fully reflected in uniform LBP algorithm because the central pixel is set as zero in coding. Although the local structural features can be extracted in this way, the spatial relationship of overall pixels in images is ignored.
Aiming at the problems existing in traditional LBP methods, an improved LBP (ILBP) algorithm is proposed in this paper.
is method calculates the global texture information and local texture information in the image by calculating the difference between adjacent pixels in diagonal positions and difference between central pixel and all pixels, so as to obtain better feature extraction results. e vibration signals of a diesel engine under eight different fault forms were collected, and a series of fault diagnosis tests were carried out. Experimental results show the effectiveness of the proposed method.

Typical LBP Operators. Local binary pattern (LBP)
algorithm is a kind of local texture feature extraction method. It creates binary coding according to the grey value difference between centre pixel and neighbourhood pixels in the sampling area and is widely used in image texture feature analysis [16][17][18][19][20][21]. e original LBP operator is defined in a rectangular neighbourhood with size of 3 × 3, and the arbitrary colour images should be converted into grey images with grey-scale value of 0∼255. Pixels of the rectangular area are used as sampling points, denoted grey value of the centre pixel as f 0 , and grey-scale value of 8 pixels around it as f 1 , f 2 , . . . , f 8 . When f i ≥ f 0 the corresponding position is encoded as 1, and when f i < f 0 the corresponding position is encoded as 0. After all pixels within the area are coded, the encoding value of 8 pixels around the centre pixel will be composed of a binary number in a clockwise direction. e LBP coding can be used as features to reflect the texture information in images, and an abridged general view of the whole extraction process is shown in Figure 1.
e coding formula of standard LBP operator can be described as e standard LBP operator only considers the sampling and coding of pixels in region of 3 × 3, so it has limitations in describing texture information of different sizes. In order to break through this limitation and collect more texture information of different sizes, Ojala extended the sampling area to a circle of any area. Set R as the radius of the circle, and set P as the number of points in the domain; LBP operator in circular domain degenerates into standard LBP operator when [R, P] � [1,8]. When calculating in other regions, the grey value corresponding to this point is calculated by bilinear interpolation if the sampling point does not fall completely on the pixel position. Increasing the number of sampling points can make LBP operator collect more texture information, but the corresponding computational complexity will also increase. In addition, if the number of sampling points remains unchanged and only the radius of the circle domain is increased, some texture information is often missed. erefore, reasonable selection should be made of the two parameters of radius R and point P in the circle domain in practical application.
Circle LBP operator allows P sampling points to exist in the region with radius R, and the coding formula can be described as When encoding an image using the circle LBP operator, P samples can generate up to 2 P different binary codes. For example, the LBP encoding value in the statistical histogram is as high as 65536 when P � 16. Obviously, such high-dimensional feature parameters cannot meet the requirements of feature extraction. So the amplitude is normalized to 255, and the binary code of 0∼255 is uniformly used for all circular domain LBP codes. e LBP operator can obtain an LBP code at each pixel. After extracting its original LBP operator from a time-frequency image, the original LBP feature is still in the form of image. e LBP spectrum can be seen as quadratic features obtained by the original time-frequency image in the original measurement space. However, it still has high dimension and cannot be directly used for discriminant analysis. So, grey histogram will be used for feature coding. Grey histogram is the function of grey level, which can reflect the occurrence frequency of each grey level in the image. e texture feature vector of the LBP spectrum is generally represented by the grey histograms [22]. Figure 2 shows the LBP spectrum of the Lena image with different circular domain radius and sampling points. Correspondingly, fineness of the texture information in the obtained LBP spectrum is different. Taking the Lena image as an example, with the increase of sampling radius, the greyscale statistical value of the LBP map is sparser. Proper sparsity is good for pattern recognition, but when the feature parameters are too sparse, the pattern recognition process will also become difficult. For different images, proper selection of the sampling number and radius is more conducive to pattern recognition. At present, the parameters still need to be selected according to different application objects since there is no consensus in practice.

Improved LBP Operator for Encoding.
In traditional LBP operator encoding process, the grey-scale difference between central pixel and neighbouring pixels in the local area is reflected in the form of encoding. e central pixel is zeroed during encoding, and spatial relationship of the entire pixel is ignored. In order to solve the problem of the traditional LBP operator, enlarge the proportion of the central pixel in sampling areas and highlight the relationship between the sampling area and the whole image; an improved LBP (ILBP) algorithm is proposed. By quantifying the difference of the grey value between the neighbouring pixels in the diagonal position and comparing the grey value of the central pixel with all the pixels, the global and local texture information can be taken into consideration at the same time. Since the ILBP operator can reduce comparisons of the sampling points, the computational complexity can also be reduced, and the sparsity is improved. Encoding rules of the ILBP operator are defined as follows: According to the coding rules of ILBP, P samples can generate up to 2 (P/2)+1 different binary codes in ILBP coding rules. For the region of 8 sample points, only 32 coded values are generated, which is less than the number of uniform modes in uniform LBP. So, it is not necessary to discard any coding information in ILBP coding. And for codes with more than 8 samples, normalization is performed according to the interval from 0 to 31 to ensure that the statistical code values obtained by the ILBP operators with different sample points are equal. Figures 3 and 4 show the LBP spectrum and corresponding statistical histogram of Lena image encoded by uniform LBP and ILBP, respectively. It can be seen from Figure 3(b) that, in texture encoding of uniform mode LBP operator, the image features are described by 59 grey-scale statistics. Dimension of feature parameters is reduced in this way, which is beneficial to the identification of failure modes. However, it can also be seen from Figure 3(a) that degree of texture fineness in uniform LBP spectrum is relatively low.

Shock and Vibration
Dimension of the feature parameters is reduced at the expense of partial differentiation information, and it is not conducive to the failure identification. e ILBP operator only uses the LBP code value of 0∼31 to express the texture information, and its code value range is smaller than uniform LBP operator. Since all information is retained during coding, the ILBP operator of image texture information is more refined than the uniform mode LBP operator.

Fault Diagnosis Process of Diesel Engine Based on ILBP
A complete fault diagnosis process for diesel engine mainly includes three parts: time-frequency characterization of vibration data, feature extraction of time-frequency images, and identification of fault state [23,24]. e experimental environment is MATLAB R2014b; the computer is configured as Intel Core i5 x64 processor, 2.80 GHz main frequency CPU, 16 GB memory, and Win10 operating system. During the experiment, the training sample set and the test sample set were randomly selected from the signals corresponding to the valve states of the diesel engines, and the experiment was carried out according to the flow of Figure 5.
Given a sample set with L classes, each sample is an image feature. e main procedure of the proposed method is listed as follows.
(1) Divide the vibration signal samples V into training set V tr and testing set V te . Randomly divide the overall sample set into two data sets. Transform all the vibration signals into time-frequency distributions T tr and T te , where short time Fourier transform (STFT), wavelet packet (WP), Wigner-Ville distribution (WVD), pseudo-Wigner-Ville distribution (PWVD), smooth pseudo-Wigner-Ville distribution (SPWVD), and Rihaczek distribution are used to generate time-frequency images for comparative analysis.
(2) e time-frequency distribution is used as inputs, and LBP operators are used to encode the timefrequency images, where circular LBP, rotation-invariant LBP, uniform LBP, and ILBP operator are applied for texture coding for comparison. In order to facilitate computer processing, the time-frequency images are displayed in the form of greyscale images. e grey level is set to 256 levels, and the maximum and minimum values in the time-frequency transform matrix are mapped to 0 grey level and 255 grey level, respectively.

Experiment Setting.
Acquisition of cylinder head vibration signal is basis for analysis of the running state. In the process of signal acquisition, signal quality is mainly affected by precision of the measurement system, measurement position, and sampling frequency. As shown in Figure 6, BF4L1011F diesel engine is used as the research object, the rated speed is 3000 r/min, and the sampling frequency is 25 kHz. We simulated seven common air valve faults in comparison with the normal state of the valve, as is shown in Table 1. e normal intake valve clearance should be 0.25∼0.35 mm, and exhaust valve clearance should be 0.45∼0.55 mm. In the experiment, 0.3 mm and 0.5 mm correspond to the normal state of clearance between intake and exhaust valve, 0.06 mm and 0.7 mm corresponding to valve clearance is too small and too large, crack of 4 × 1 means to open a hole of 4 × 1 mm 2 on the air valve to simulate the state of serious air leakage, and new valve of 0.50 represents the valve clearance being adjusted to 0.5 mm, to simulate slight air leakage failure when the valve is not worn. Vibration signals of 60 sample groups in 8 states are collected and analysed.   Shock and Vibration domain, the signal frequency band is concentrated at about 6.0∼9.0 KHz under normal working condition and concentrated at 10.0∼12.5 kHz at working conditions 2, 3, 4, 5, 7, and 8. It is also difficult to distinguish working states from the frequency characteristics. From the point of this view, it is necessary to apply time-frequency analysis.
In order to further analyse the application effect of simple time-domain and frequency-domain analysis methods on diesel engine fault diagnosis, we have calculated the most widely used root mean square (RMS) as the timedomain characteristic indicator. In addition, we also used the method of fast spectral kurtosis to statistically analyse the kurtosis index of the signal. Among them, the results of the kurtosis graphs for working conditions 1, 5, and 8 are shown in Figure 8. e kurtogram shows kurtosis results for a range of window lengths and frequencies. A high kurtosis level corresponds to a high level of nonstationary or non-Gaussian behaviour. e peak kurtosis is provided in the text at the top, along with the window length and centre frequency associated with it. e bandwidth is a function of the window length. Table 2 lists the RMS value of signals under 8 working conditions, as well as 4 typical statistics (K max , optimal window length, centre frequency, and bandwidth) in kurtosis.
As can be seen from Figure 8, the kurtosis index of signals under three working conditions showed relatively similar results. eir fast spectral kurtosis diagram has the same optimal window length, centre frequency, and bandwidth, which will bring difficulties to pattern recognition. From Table 2 we found that RMS values of signals under different working conditions are not significantly different. Figure 9 shows the confusion matrix of fault classification results based on RMS and fast kurtogram, respectively. SVM and NNC are applied here for comparison of the feature extraction effect. Among them, the SVM fault multiclassification algorithm uses the radial root centre map as the centre map. e main parameters of the radial root mapping SVM include the commandment parameter C and the root centre mapping width g. Before the input samples are projected to the appropriate higherorder feature dimension boundary, the optimized C and g can be screened to obtain more accurate multipartition results. Using the grid search algorithm, this algorithm can find multiple sets of numbers in several extended dimensions. Its strengths are that it can optimize multiple parameters in parallel at the same time and can accurately lock a single parameter. NNC performs classification calculation directly based on the Euclidean distance, which avoids the selection of parameters and is a more basic classification method. e average recognition accuracy obtained by the four methods is 50%, 61.38%, 71.63%, and 77.13%, respectively. Using only RMS as the characteristic index to identify faults, the recognition accuracy rate does not exceed 70%,    Shock and Vibration

Time-Frequency Characterization of Vibration Signal of Cylinder Head of Diesel
Engine. e most widely used timefrequency analysis methods for nonstationary signals are linear time-frequency analysis methods and nonlinear timefrequency analysis methods [25,26]. e typical linear timefrequency analysis method is STFT and WP distribution. And the nonlinear time-frequency analysis is represented by the Cohen class bilinear time-frequency distribution. Basis for nonlinear analysis methods is WVD, which can achieve the same resolution as Fourier transform, but there is an inherent defect, that is, the cross term. e cross term can seriously affect the useful signal spectrum. ere are many derived algorithms based on WVD, and the most widely used methods are PWVD, SPWVD, and Rihaczek distribution. ese methods can obtain the distribution of timefrequency components of different effects with different time and frequency resolution. Figure 10 shows the results of the time-frequency analysis of the diesel engine vibration signals under eight operating conditions using SPWVD. From the figure, the    Figure 11. In the WVD distribution, the phase information is amplified and more cross interference terms appear; both PWVD method and the Rihaczek method have a certain suppression effect on the cross terms. STFTand WP methods are linear time-frequency analysis methods, so they are not affected by cross terms, but their time-frequency aggregation is relatively low. Figure 12 shows the LBP spectrum of the WVD distribution under normal condition obtained by five different LBP methods. For the sake of contrast, value of the background pixels (0 or 255 pixel value) is removed when drawing the histograms. e original WVD image is reencoded by the LBP operator. e texture features in the original image are highlighted, and the pixel coding has obvious partitions. Corresponding to different domain radius and sampling points, fineness of the texture information in obtained LBP spectrums is different. As the sampling radius increases, greyscale statistical value of the LBP map is more and more sparse. At present, there is no consensus of the parameter selection, and it needs to be selected according to different application objects. Although the rotation-invariant LBP operator has good rotation invariance, it is found in practical applications that rotation-invariant coding may reduce its classification ability. Uniform LBP reduces the feature parameter dimension but at the expense of losing partial image information, which is not conducive to the identification of diesel engine fault mode. e ILBP operator only uses the LBP code value of 0∼31 to express the texture information of the original image, and its code value range is smaller than the uniform mode LBP operator. And the ILBP operator characterization of image texture information is much more refined.

Comparison of Fault Identification Accuracy.
Encoding parameters [R, P] of LBP are determined. In the test, 60 groups of vibration signals were collected under each working condition, and the duration of each group of signals was 0.08 s. 30 groups were randomly selected from the data  of each working condition as training set samples, and the rest of the samples were set as the testing data. All the images are binary coded by circular LBP operator with different parameters [R, P] for comparison. e corresponding classification result based on circular LBP and WVD timefrequency image is shown in Figures 13 and 14 explaining SVM parameter selection results when [R, P] � [2,16].
In Figure 13, whether SVM or NNC is used as the classifier, the highest recognition accuracy rate is achieved when [R, P] � [2,16]. e correct recognition rate is up to 90% for SVM and 83.33% for NNC. In conjunction with Figure 14, it can be seen that the parameters of the SVM are selected as c � 0.70711 and g � 11.3137. It indicates that when the radius of the operator reaches is 2 and the number of sampling points is 16, the texture information of the timefrequency image has a good description ability. erefore, this parameter combination is set as [R, P] � [2,16] in the subsequent valve fault diagnosis. We use the circular LBP operator, rotation-invariant LBP operator, uniform mode LBP operator, and ILBP operator to extract features of the STFT, wavelet packet, WVD, PWVD, SPWVD, and Rihaczek time-frequency distribution images.
We use SVM and NNC as the classifier, and the corresponding recognition results are shown in Figure 15. Under the same radius and the number of sampling points, recognition accuracy of ILBP and uniform LBP is generally higher than that of circular LBP and rotation-invariant LBP. In Figure 15(a), when NNC is used as the classifier, the ILBP∼WP method achieved the highest recognition accuracy of 96.67%, followed by the uniform mode LBP∼WP method and ILBP∼WVD method with accuracy of 94.17%. In Figure 15(b), when SVM is used as the classifier, the  recognition accuracy of ILBP∼WP is also the highest, which is 95.83%. On the whole, the four LBP operators have better feature extraction effect on wavelet packet time-frequency image, and feature extraction effect on STFT time-frequency images is the worst. In addition, the highest recognition accuracy rate can reach more than 95% whether SVM or NNC is used as classifier, which also shows the effectiveness of the local binary mode method for diesel engine fault diagnosis.

Feature Extraction Calculation Efficiency Comparison.
To compare the computational efficiency between different LBP operators, time consumption in 6 kinds of time-frequency images extracted by different LBP operators is shown in Table 3 not including image loading time. Radius of the circle domain and number of sampling points are the same. As can be seen, rotation-invariant LBP and uniform mode LBP operator need to consume part of time in binary code selecting, so the total time of feature extraction is higher. ILBP operator reduces the multiplication times of encoding due to changing of the coding mode of LBP, and the feature extraction efficiency is higher than other types of LBP operators.  [3,24], we can see that number of sampling points has a large impact on the time required for LBP feature extraction. In practical application of LBP operator, appropriate circle radius and number of sampling points should be selected according to the application object, so as to take into account the effect of feature extraction and computational efficiency.  Table 5 shows the time taken by the above 6 time-frequency analysis methods to generate a time-frequency image. Among the 6 time-frequency analysis methods, wavelet packet has the highest computing efficiency, while WVD has the lowest computing efficiency. Combined with the results in Figure 15, we believe that the combination of WP time-frequency images and ILBP is an efficient and high-precision method for diesel engine fault diagnosis.

Comparison with Other Related Works.
To further illustrate the advantage of the proposed ILBP method, several related works are introduced for comparison. One is the fault diagnosis approach for diesel engines based on selfadaptive WVD, fast correlation-based filter, and relevance vector machine proposed in [10]; the other is the fault diagnosis method of diesel engine valve clearance using the improved variational mode decomposition (VMD) and bispectrum algorithm proposed in [2]. e hamming window with width of 115 is selected in the WVD; Euclidean distance and grid search algorithm are used for parameter selection in RVM. Decomposition layer K is set as 6 in VMD when the fluctuation of central frequency is the smallest. Figure 16 shows the confusion matrix of pattern recognition results based on the WP-ILBP-NNC method, WP-ILBP-SVM method, WVD-FCBF-RVM method, and VMDbi spectrum method. e training set and test set are divided into eight categories, with the horizontal axis representing the prediction label and the vertical axis corresponding to the real label. e average recognition accuracy of the     method proposed in this paper reaches 96.67% and 95.83%, while the other two methods are 92.88% and 88.25%, respectively. In method 1 (corresponding to Figure 16(a)), the recognition accuracy under working conditions 1, 6, 7, and 8 is all 100%, and in method 2 (corresponding to Figure 16(b)) the recognition accuracy under working conditions 1, 7, and 8 is all 100%. e minimum recognition accuracy of both methods also reached 90%. In method 3 (corresponding to Figure 16(c)) and method 4 (corresponding to Figure 16(d)), the highest recognition accuracy is only 97%, and the lowest recognition accuracies are 90% and 83%, respectively. e results show that the proposed method has obvious advantages over the other two methods.

Conclusion
Aiming at the problem of internal combustion engine fault diagnosis, a visual analysis method based on ILBP algorithm is proposed in this paper. To fully use the texture feature information in vibration time-frequency images of diesel engine, an improved local binary algorithm (ILBP) is put forward. e work of this article can be summarized as in the following three points: (1) In this paper, a new LBP coding rule is proposed, which can obtain more sparse texture coding and accurately describe the texture information of images. e proposed ILBP operator is compared with circle LBP, rotation-invariant LBP, and uniform LBP in experiment from two aspects: feature extraction effect and computational efficiency. e results show that the proposed ILBP operator can better describe the texture characteristic information of the timefrequency image of the diesel engine and has a good diagnostic effect.
(2) Different time-frequency analysis methods have different ability of characterizing the running state of diesel engines. Six different time-frequency analysis images, including STFT, WP, WVD, PWVD, SPWVD, and Rihaczek distributions, are also compared. From the results, WP time-frequency image generation is the fastest, and the use of ILBP algorithm for texture feature extraction and fault diagnosis has the best effect, so it is a recommended method. (3) In addition, the proposed method is compared with two related methods. Time-frequency analysis has obvious advantages over VMD based timedomain signal analysis method. At the same time, compared with the time-frequency analysis method of WVD-FCBF, the proposed WP-ILBP based diesel engine fault diagnosis method obtained better results.

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 there are no conflicts of interest regarding the publication of this paper.   14 Shock and Vibration