{'fraction_non_alphanumeric': 0.025052192066805846, 'fraction_numerical': 0.010438413361169102, 'mean_word_length': 4.828690361831573, 'pattern_counts': {'":': 0, '<': 2, '<?xml version=': 0, '>': 1, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
On-Line Fault Diagnosis Method for Power Transformer Based on Missing Data Repair

Data quality is an important factor affecting the accuracy of transformer fault diagnosis. In order to reduce the impact of missing data, an on-line fault diagnosis method using a loop iterations of improved k-Nearest Neighbour (kNN) and multi-class SVMs based on the missing data repair is proposed in this paper. In the kNN method, the improved Manhattan distance weighted by the negative exponent of the correlation coefficient is designed to measure the distance between samples. On one hand, the influence of the strong correlation indicators on the missing data can be highlighted to improve the accuracy of data repair. On the other hand, the improved Manhattan distance is suitable for an efficient search strategy based on the k-d tree which can achieve the fast search for massive historical data and meet the real-time demand of on-line diagnosis. Diagnosis test results show that the proposed method can keep the high diagnostic accuracy on the incomplete data and realize the efficient on-line fault diagnosis for transformers.


Introduction
The transformer is an important equipment and core component of the entire substation system and even the power grid which is responsible for the conversion and transmission of electrical energy. Once the transformer especially the oil-immersed main transformer fails, it will affect the safe and stable operation of the power grid and lead to severe economic losses. Dissolved gas analysis (DGA) is the widely recognized method to detect latent faults of transformers [1][2][3]. With the development of smart substations, oil chromatographic online monitoring devices have become widely applied in power systems [4]. However, due to the constraints of objective conditions such as network topology, geographical environment, and economic factors, the most transformer on-line monitoring systems still use low-quality communication modes like power distribution carrier, Zigbee wireless technology, and industrial distribution. These low-cost channels often occur broken codes under the attack of overvoltage, high-current and other strong electromagnetic interference resulting the loss of monitoring data [5]. The incompleteness of oil chromatographic data will seriously affect the accuracy of transformer fault diagnosis, and even lead to unavailability of traditional methods. Therefore, how to use the incomplete data to achieve accurate and fast online diagnosis for transformer faults has attracted wide attention in academic and industrial circles. At present the fault diagnosis of transformers based on the incomplete data has two main ideas. The first idea is to clean the bad data and then use existing models such as neural network [6][7][8], Bayes classifiers [9][10] and support vector machines [11][12][13][14] to classify the failure type. There are some research results on the methods of cleaning transformer online monitoring data. The literature [15] treats the missing values as one type of outliers and a time-series analysis method is utilized to identify the data anomaly patterns. Then the autoregressive integrated moving aver-age model (ARIMA) model is adopted to fit the data curve. Literature [5] proposes a method based on Pearson correlation coefficient and regression model to achieve the recovery of missing data. In literature [16] the wavelet neural network model is used to predict the missing data and correct the error data. And the effect of data cleaning can be improved by modifying the wavelet neural network parameters and combined prediction. The above data cleaning methods are all based on the time series analysis. When the missing data is in the middle of the time series, they will have satisfying performance. However, in the actual situation, the missing data is generally at the end of the time series. In addition, there are few literatures discussing the computational efficiency of the cleaning method under the large sample of oil chromatographic data.
Another idea is to select some flexible methods to deal with the missing data in the monitoring results. The rough set theory is a typical method. The literature [17] uses the rough set to reduce the transformer state information, and diagnoses transformer faults based on the reduction set. A transformer fault diagnosis method combining with Bayesian network classifier and rough set is proposed in [18]. This method has the fault-tolerance characteristics, and its performance is obviously better than using Bayesian classifier or rough set separately. The advantages of the rough set theory is that it can effectively analyse and deal with the inaccurate and incomplete data and extract implicit knowledge from a large amount of information. Nevertheless, when there is the lack of key characteristic indicators, the accuracy of such fault diagnosis method will rapidly decline.
Aiming at the deficiencies in the above studies, this paper proposes an online fault diagnosis method for the incomplete oil chromatographic data based on an improved k-Nearest Neighbour (kNN) and multi-class SVMs. This method which designs a loop iteration mechanism for data repair and fault diagnosis inherits the first idea. The reminder of this paper is structured as follow: section 2 introduces a data repair method based on improved kNN, fast search strategy is described in section 3, a cycle iterative diagnosis method is presented in section 4, case study on 309 sets of real oil chromatographic data is shown in section 5, followed by conclusions in section 6.

Data Repair Method based on Improved k-Nearest Neighbour
The k-Nearest Neighbour (kNN) algorithm is a supervised learning method for finding samples with the similar data pattern. This paper is based on a basic idea that the same transformer fault has a similar data pattern. An improved kNN method is proposed to repair the missing transformer oil chromatographic data. The working mechanism of this method is as follows: 1) input the incomplete test sample, 2) find the k nearest training samples in the history oil chromatographic database, 3) synthesize the k samples' information to estimate the missing data. In order to highlight the correlation between different oil chromatographic indicators, a modified Manhattan distance using the negative exponent of the correlation coefficient as the weight coefficient is adopted to measure the distance between two samples.
Assume that there are N sets of transformer oil chromatographic history data as training samples, and each sample   12 , ,..., has m characteristic gas indicators. The correlation coefficient ρ pq between indicator p and q can be calculated as follow. Where μ is the mean value of the corresponding characteristic gas indicators. The range of the correlation coefficient is [-1, 1] where -1 (1) denotes strong and negative (positive) correlations between the two characteristic gas indicators and 0 means no correlation. If two characteristic gas indicators have the close correlation, it is more credible to use one of them to estimate the other.
When the test sample x j lacks the pth (1≤p≤m) gas indicator x jp , the improved Manhattan distance between the test sample j and the training sample i is formulated as follow: By weighting the spatial distance of the gas indicators with the negative exponent of correlation coefficient, the correlation between the gas indicators can be reflected. Therefore, the test sample is more likely to approach the training sample which is closed on the strong correlation indicator. Select the k nearest training samples and calculate the mean of the corresponding gas indicators as the estimated value of the missing data: Compared with the traditional stochastic filling or time series data repair methods, the improved kNN method considers the similarity of the oil chromatographic data pattern for the same transformer fault type. And due to breaking the temporal correlation of oil chromatographic indicators, it is suitable for the repair of missing data in the event of rapid changes during the development of faults.

Fast Sample Search Strategy Based on K-D tree
With the wide utilization of online monitoring devices for transformer oil chromatography, the volume of the monitoring data has increased dramatically. Taking a provincial power grid for example, the number of oil-immersed transformers above 220 kV is over 2,000. Millions of oil chromatographic data are produced every year, reaching the GB level of data volume. If the traditional linear scanning method is still used to find the k nearest training samples from the massive historical database, the calculation efficiency and operating speed will not meet the on-line requirements. The improved Manhattan distance presented in section 2 is suitable for a fast sample search strategy based on k-d tree.

Construction of K-D tree
Each oil chromatographic sample usually contains 5-8 indicators, so an oil chromatographic sample set corresponds to a high-dimensional data space. The k-d tree, as a data structure for partitioning kdimensional data space, can be applied to the search of key data in high-dimensional space. Figure 1 illustrates the structure and generation process of a k-d tree with k = 3. The generation process of a k-d tree includes the following three main steps: Step1: Calculate variances of samples for each dimension. Select the dimension corresponding to the maximum value of the variance as the split field for effectively guaranteeing the balance of the tree.
Step 2: Sort the sample according to the value of the split dimension, and the intermediate data point is selected as the pivot point which is represented in bold in Figure 1.
Step3: The samples are divided by the pivot point to form the left and right k-d subtrees. When the size of the subtree is smaller than the acceptable number of leaf nodes, the operation of generating the k-d tree is terminated otherwise return to Step 1. In Figure 1, the acceptable number of leaf nodes is 2.
When this method is applied to the structured storage for transformer oil chromatographic data, each sample is stored in one node of the k-d tree containing k indicators.

Neighbour Search Strategy
The data structure based on k-d tree can achieve efficient neighbour search for oil chromatographic sample data. The literature [19] has proved that the complexity of neighbour search using k-d tree is O (log n), where n is the number of samples. When applied to the search of massive high-dimensional samples, it has significant advantages compared with the linear scan algorithm with the complexity of O(n). The neighbour search strategy based on k-d tree structure contains the following three steps.
Step1: Find the leaf node where the test sample is located along the k-d tree, get the nearest sample, and add all of the nodes on the search path to a queue.
Step2: Make a hypersphere around the nearest sample with radius of the distance between the test sample and the nearest sample. Verify whether the sample in the queue is within this hypersphere. If not, remove the sample from the queue and repeat Step 2 until the queue is empty, otherwise go to Step 3.
Step3: Update the nearest sample, add its child node in the queue, and return to Step 2.

Design of Multi-class SVMs
The basic idea of the SVM algorithm is mapping the linearly inseparable sample data to highdimensional feature space through a kernel function, which may be constructed as a linearly separable problem. By solving a convex optimization problem, the optimal hyper plane is obtained which can be utilized to achieve data classification. Since the selection of the optimal hyper plane only depends on support vectors, this method is robust and has a good generalization performance when applied to the transformer fault diagnosis. A single SVM can only solve a binary classification problem. In this paper, a multi-classifier containing 8 SVMs is designed to achieve accurate diagnosis for 6 main fault types.
The structure of multi-class SVM classifier is shown in the figure 3.

Cycle Iteration Fault Diagnosis Process
In the transformer fault diagnosis method based on incomplete data, the kNN method is used for the repair of missing data, and the multi-class SVMs classifier performs fault diagnosis based on the repaired sample. According to the results of the diagnosis, the sample space is reduced. And the missing data is re-estimated using the new k nearest neighbour samples. This iteration is cycled until the fault type of the neighbour sample is consistent with the fault diagnosis result of the test sample. The fault diagnosis process based on the missing data repair is shown in Figure 4, which specifically includes the following five steps: Step1: Input the oil chromatographic data. If there is a missing indicator, apply the kNN method to repair.
Step2: Use the multi-class SVMs model for fault diagnosis.
Step3: Judge whether the diagnosis result is consistent with the fault types of the k nearest training samples. If there is any inconsistency, go to Step 4, otherwise go to Step 5. Step4: Select the historical samples which have the same fault type with the multi-class SVMs's diagnostic results as the new sample space. And re-use the kNN method to estimate the missing data. Go back to Step 2.
Step5: Obtain the fault diagnosis result, store the repaired data and diagnostic result in the historical database, and retrain the SVM multiple classifier periodically.

Case Study
In the case study, 309 sets of complete transformer oil chromatographic sample with the identified fault type, including thermal fault at <300°C (T1), thermal fault at 300°C-700°C (T2), thermal fault at >700°C (T3), partial discharge (PD), low energy discharge D1, and high energy discharge (D2), has been collected. And the incomplete data samples are constructed by random deletion. To facilitate results comparison, the leave-one method (LOOM) [20] is used to calculate the diagnostic accuracy rate for three different methods: kNN+ multi-class SVMs (proposed in this paper), ARIMA+ multiclass SVMs and rough set method. has the equal classifier performance in the literature [21]. When the rough set method is applied to the incomplete data, the diagnostic accuracy is reduced to 59.09%. This is because the gas indicator is determinant attributes which seriously affect the accuracy of fault diagnosis.
Compared with the 3rd, 4th and 5th column data, the diagnostic accuracy dropped from 83.17% to 74.11% by using the ARIMA+ SVMs method. When using the kNN+ SVMs method proposed in this paper, the accuracy rate is 78.64% with only 4.53% reduced. Therefore, the high accuracy of the multi-class SVMs can still be maintained. A specific example is illustrated in the Table 2 and Figure 5 for the further analysis between the ARIMA+ SVMs and kNN+ SVMs.  Figure 5. Missing data predict using ARIMA (*, 12.85, 3.65, 2.6, 0) is an oil chromatographic sample with five indicators which corresponds to the gas of H 2 , CH 4 , C 2 H 6 , C 2 H 4 , and C 2 H 2 respectively. * denotes the missing data of H 2 , and the actual value is 80.9μL. The final five closest data samples searched in the historical database by using the kNN method is shown in Table 2. The estimated value of H 2 is 82.867μL with the relative error of 2.44%. The result of the fault diagnosis result using the repaired sample data is thermal fault at <300°C (T1) which is consistent with the actual situation. When the ARIMA method is adopted to fit the history data of the H 2 , the fitted curve is presented in Figure 5 and the predicted value is 68.02μL. Based on the predicted data, the result of the fault diagnosis is thermal fault at 300°C-700°C (T2) which is incorrect.
It can be seen from the Figure 5 that due to the rapid increase of H 2 in the fault development course, the ARIMA method overfits the historical data under the normal condition leading to a conservative final predicted result. Compared to the predicted method based on the timing characteristics, the kNN method is a global related search strategy that breaks the mandatory association relationship of oil chromatographic data from the perspective of time. Therefore, it has an obvious advantage when applied to the rapid development of faults.

Conclusion
With the popularization and application of the transformer on-line monitoring system, the quality of monitoring data has gradually attracted people's attention. For the incompleteness of oil chromatographic monitoring data, the traditional transformer fault diagnosis method has a rapid  8 decline in accuracy or even cannot be applied. In this paper, an online transformer fault diagnosis method based on missing data repair is presented and the main innovations are as follows: 1) A fault diagnosis method based on the loop iteration of kNN and multi-class SVMs is proposed, which improves the accuracy of transformer fault diagnosis based on incomplete data.
2) An improved Manhattan distance with the negative exponent of the correlation coefficient as the weight is used to measure the distance between samples. Therefore, the influence of the strong correlation indicators can be highlighted.
3) The k-d tree-based data structure is applied to speed up the search in massive historical samples to meet the actual needs of transformer on-line fault diagnosis.
The results of the case study show that the proposed method can realize on-line transformer fault diagnosis based on incomplete data and adapt to the trend of power transmission equipment big data. Compared with the methods based on rough set theory or time series data prediction, the proposed method still has a higher diagnostic accuracy rate in the incompleteness of the key indicator or the situation of rapid development of faults. But there are also some limitations. This method is only applicable to the repair of missing data, but it does not have the ability to identify the wrong data. At the same time, more monitoring data and maintenance records should be used to evaluate the dynamic state of transformers which is also the direction of work for further research.