Flagging Implausible Inspection Reports of Distribution Transformers via Anomaly Detection

Distribution transformer is the key equipment in the distribution power grid, and sampling inspection is the main method used to ensure quality control. Inspection comprises many testing processes. Due to various reasons, the testing results may occasionally have errors and be implausible. Only a few errors can be detected empirically by inspectors. To solve this problem, anomaly detection is proposed in this paper to determine implausible inspection reports and assist in re-inspecting. The well-known and representative anomaly detection algorithms, which are now used in many application domains are introduced. These algorithms include single Gaussian distribution and multivariate Gaussian distribution, local outlier factor, one-class SVM. Based on the distribution transformer inspection reports collected, anomaly samples are constructed manually. Train datasets and test datasets are then formulated. By comparing the testing results, the one-class SVM algorithm can detect anomaly samples in testing datasets correctly. Thus, it can be used to distinguish the abnormal samples (i.e., reports with measurement errors suspected) in the inspection reports of distribution transformer, which can help inspectors complete their inspecting work correctly and effectively.


I. INTRODUCTION
Distribution transformer (DT), i.e. power transformer normally working at 35kV and 10kV voltage levels, is the key equipment in the distribution power grid, and its quality is of great significance to the security and stability of the power grid [1]. In recent years, the Chinese Power Grid purchased a large number of DTs yearly with the rapid development of power grid construction. Sampling inspection is the main method used to control the quality risk for the users, and it is conducted according to regulations of the power grid in purchasing. Many testing items and procedures exist in the inspections of DTs [2]- [4]. Due to the abnormal operation of measuring instruments, the interference of environmental factors, the negligence of the inspectors and other special circumstance factors, measuring errors and implausible testing reports would possibly occur, thus leading to misjudgment in DT inspection. Therefore, certain unqualified products are used in the power grid, thus bringing risks on the stability and safety of the power grid. To solve this problem, inspectors The associate editor coordinating the review of this manuscript and approving it for publication was Canbing Li . judge whether to re-test the DT by their experience when certain measuring results in the inspection are approaching the qualified limit. However, only a few measurement errors can be detected manually.
This remedy is unscientific and unreliable. Hence, we proposed using anomaly detection [5]- [7] to flag the implausible inspection reports of DTs in this paper, which can find potential inspection reports with measuring errors and assist inspectors in deciding whether to re-test DTs. This research can improve the accuracy and efficiency of DT inspection.
Anomaly detection is widely applied in various fields, such as intrusion detection, fraud detection and data preprocessing [7]- [11]. In industry applications, anomaly detection can be used to determine the hidden quality defects in monitoring and measurement. Sharifzadeh et al. [12] studied the abnormality detection strategies for surface inspection. Omenzetter et al. [13] proposed a method of outlier detection in multivariate data for finding and localizing sudden events in strain data. Staar et al. [14] indicated that a deep metric learning with triplet networks could be used on surface anomaly detection. Liu et al. [15] provided an unsupervised anomaly detection framework to analyze remotely sensed data. Goi and Kim [16] employed the Bayesian outlier detection for the health monitoring of bridges. Shaadan et al. [17] used a multivariate robust distance method for the detection of anomalies and assessment of PM10 functional data in Malaysia. Napoletano et al. [18] proposed a method for the automatic detection and localization of anomalies within SEM images of nano fibrous materials. Archimbaud et al. [19] discussed detecting automatically multivariate outliers in high reliability standard fields. Estiri et al. [20] applied anomaly/outlier detection methods to flag implausible record values in Electronic Health Record (EHR) data by using clustering algorithm.
The main contributions of this paper are as follows: 1. The issue of flagging the implausible reports in DT inspection is introduced and analyzed. To solve this problem, we suggest using anomaly detection to detect the implausible samples in DT inspection reports.
2. In the case of insufficient samples collected, we propose a method to construct abnormal samples based on our investigation.
3. The typical anomaly detection algorithms are introduced and applied to flag the abnormal report samples in DT inspection. 4. By comparing the testing results, the one-class SVM algorithm can detect anomaly samples correctly and flag the implausible inspection reports.
The rest of the paper is organized as follows: Section II introduces the knowledge of DT inspection. Section Ø presents the typical anomaly detection algorithms, such as single Gaussian and multivariate Gaussian distribution [21], OC-SVM, Local Outlier Factor(LOF) [5], [6] and [22]. Section IV illustrates how to construct samples and datasets. In Section V, different anomaly detection algorithms have been used to detect abnormal samples in datasets. Finally, conclusions are drawn in Section VI.

A. INSTRUCTION TO DT INSPECTION
As the most important devices in the distribution network, many types DTs are available. For example, the most common 10kV DTs can be divided into two categories, namely, oil-immersed and dry. The 10kV oil-immersed transformers which commonly used are also divided into 100kVA, 160kVA, 200kVA, 315kVA, and 400kVA, according to their rated capacity.
For the 10kV oil-immersed transformer, the tests include sampling inspection, routine test, type test, special test, and hand-over test [3]. The items are different due to the different test purposes. The sampling inspection for DTs aims to find the quality defect, which forces suppliers to pay more attention to quality. It occupies the main proportion of DT inspection. Therefore, in this paper, we focus on flagging the implausible inspection reports for sampling inspection of 10kV DTs in purchases.
During the sampling inspection of the commonly-used 10kV oil-immersed transformers, a series of routine test items are usually conducted, which include measuring temperature rise, voltage ratio, winding resistance, short circuit impedance, load loss, no-load current, no-load loss, partial discharge and insulating oil test, et al.

B. ANOMALY DETECTION IN DT INSPECTION REPORTS
Due to various factors, measuring errors during the inspecting of DTs is inevitable, while these errors are few. Generally, identifying these measuring errors is difficult. In certain cases, if some values are obviously abnormal but within the qualified range, for example, if the measuring value is 490 and the qualified range is from 0 to 500, then the inspectors would re-inspect it according to their experiences. But whether to re-inspect would completely rely on the experience and intuition of inspectors. Only a few measuring errors can be found.
According to statistical probability, measurement results that are close to the majority are considered correct and reliable. Comparing with the correct inspection reports data, the data with errors would have a different spatial distribution. Thus, flagging the implausible inspection reports of DT can be transformed into anomaly detection in the DT inspection reports.

C. SIAMPLE COLLECTING
This study requires all samples in the dataset that belong to the same specific type, which ensures all samples in the dataset to have similar characteristics. Many subdivisions of DT exist, whereas the test reports are scattered. Therefore, collecting specific samples is difficult. For example, the 10kV oil-immersed transformers with a 100kVA capacity are most commonly used in distribute power grid. All inspection reports of 10kV oil-immersed transformers with a 100kVA capacity in the past three years are collected and analyzed, and we obtained 120 inspection reports. After excluding certain incomplete reports, only 107 reports are validated and sorted out. Consequently, the number of samples for our study is small and all of them are qualified inspection reports.

III. ANOMALY DETECTION ALGORITHMS INTRODUCING A. ALGORITHM CLASSIFICATION
Anomaly detection is the process of identifying unexpected items or events in datasets, which differ from the norm. According to the deference of the train dataset label, the anomaly detection methods commonly used are divided into three categories, namely, supervised, semi-supervised and unsupervised anomaly detection [6] and [23], which are illustrated in Fig.1.

B. ANOMALY DETECTION METHODS FOR DT INSPECTION
The number of anomaly samples accounts for a small proportion. Consequently, supervised anomaly detection algorithms require numerous of samples, and they are rarely used in VOLUME 8, 2020 applications. The anomaly detection algorithms commonly used are semi-supervised and unsupervised. The second is dominant.
Theoretically, the DT inspection report samples collected contained normal samples and possibly few abnormal samples (because few DT inspection reports may have errors), and semi-supervised algorithms may not be suitable to detect anomalies, in which training datasets should have no anomaly. Even so, OC-SVM as a semi-supervised method is widely used in many applications, as it only needs a small amount of train datasets. Furthermore, it can achieve effective classification, and it is suitable for anomaly detection in highdimensional space without knowing about the distribution of sample data in advance. Therefore, OC-SVM can be used as a good anomaly detection method in DT inspection, especially when there are not many samples for training.
In this study, certain typical and well-known anomaly detection algorithms, such as single Gaussian distribution, multivariate Gaussian distribution, LOF and OC-SVM, are used. Their simple introduction is described in the following:

1) SUPERVISED ANOMALY SINGLE GAUSSIAN DISTRIBUTION DETECTION
Given the n-dimension dataset (x 1 , x 2 , x 3 , . . . . . . , x n ) which obeys the normal distribution (µ, σ ).The abnormal rate of the i-th sample in the dataset can be defined as follows: If Z i ≥ Zthr, the i-th sample is considered as an abnormal sample. Zthr is a threshold, which is usually taken as 2.5, 3.0, and 3.5. This anomaly detection method is also called Z-score.

2) MULTIVARIATE GAUSSIAN DISTRIBUTION BASED ON SINGLE GAUSSIAN
Given the dataset . . ., m}, it can calculate the mean µ j and variance σ j of each dimension as follows, j ∈ {1, 2, . . . ., n}: x i,j 75800 VOLUME 8, 2020 Under the assumption of normal distribution, given a sample x (n-dimensional variable), the probability density of x can be calculated as follows: According to the calculated probability density value of p( x), it can judge whether the sample x is abnormal. Obviously, the smaller the value, the more likely it is to be abnormal.

3) LOCAL OUTLIER FACTOR
The local outlier factor [22] is the most well-known local anomaly detection algorithm and its idea is adopted in many nearest-neighbor based algorithms today. To calculate the LOF score, three steps have to be computed [6].
1. For each record x, the k-nearest-neighbors must be found. In case of distance tie of the k th neighbor, more than k neighbors are used.
2. Using these k-nearest-neighbors N k , the local density for a record can be estimated by computing the local reachability density (LRD) as follows: whereas dist k (.) is the reachability distance. Generally, it is the Euclidean distance.
3. Finally, the LOF score is calculated by comparing the LRD of a record with the LRDs of its k neighbors: LOF score is basically a ratio of local densities, resulting in the nice property of LOF, in which normal instances, where densities are as large as the densities of their neighbors, and obtain a score of about 1.0. Anomalies, which have a low local density, will result in larger scores. At this point, it is also clear why this algorithm is local: it only relies on its direct neighborhood and the score is a ratio mainly based on the k neighbors only. Of course, global anomalies can also be detected since they also have a low LRD when compared with their neighbors. The setting of k in this algorithm is crucial, as it would try out different values for k.

4) LOCAL ONE-CLASS SVM
Given a sample D = {x i , x i , · · · , x m }, it supposes that the sample data comprised two classes. All sample data are labeled by y i = ±1. The one-class SVM is searching for a hyperplane between the two classes, which maximizes the margin between the closest data of two classes. These data (points), which are lying on the boundaries are called support vectors. For describing the one-class SVM, additional notation is needed.
Let : R n → H be the nonlinear mapping from data space R n to feature space H , ξ i is a slack variable and one for each data in D; ρ is the distance to the origin in the feature space. w is the parameterization of the hyperplane separating the origin from the data in H , and v is the expected fraction of data points outside the estimated support.
The one-class SVM algorithm computes the support vectors in D by considering the constrained quadratic optimization problem as follows: min w∈H,ξ i ∈R,ρ∈R which can transform into its dual form The kernel function k(x i , x j ) = (x i )· (x j ) is introduced into the calculation, generally, it uses the Gaussian: a i and ρ can be solved from Eq. (6) and Eq. (7) respectively. Thus, it can obtain the decision function.
A negative value of f (x) indicates that x is an anomaly data (point). Addition details about the one-class SVM algorithm can be found in the literature [24].

IV. SAMPLES AND DATASETS CONSTRUCTION A. SAMPLE FEATURES SELECTING
As mentioned in Section II, we collected 107 valid inspection reports of the 10kV oil-immersed transformer with a capacity of 100kVA as samples. Fifty-eight test items are in each DT inspection report, such as DC resistance, short-circuit resistance, ground resistance, unbalance rate, no-load loss, shortcircuit loss, induced voltage withstand, external voltage withstanding, temperature rise test. According to previous studies [2]- [4], five important items have higher unqualified rates in DT inspections, compared to other items, namely, temperature rise, DC resistance measurement, no-load current and no-load loss, load loss and short-circuit impedance, field oil withstand voltage test. Especially, three items among them, temperature rise, no-load loss, and load loss, which are easily VOLUME 8, 2020 to be interfered by inspection equipment factors and human factors. Thus, their probability of incorrect measurement is larger than other test items. Consequently, our study focused on detecting anomaly in these three test items of DT inspection reports. As a result, the inspection reports collected with 58 test items were sharpened as a five-dimensional dataset with 107 samples. The data distribution space of the three items in the sample dataset (five-dimensions) is shown in Fig.2.

B. ANOMALY SAMPLES CONSTRUCTED MANUALLY
To test the anomaly detection algorithms, abnormal samples are constructed to simulate the measurement errors during DT inspection. Considering that measurement errors may happen with a small probability under normal circumstances, at most one measurement error may occur within the three main test items (temperature rise, no-load loss, load loss) in each DT inspection report. One of 107 normal samples is randomly selected as the mother sample, while nine abnormal samples are constructed based on this mother sample. Each abnormal sample is constructed by changing one value of the three main test items of the mother sample. The original values of load loss, no-load loss and temperature rise of the mother sample are 1257.36 (qualified range is ≤1580), 141.44 (qualified range is ≤290), and 51 (qualified range is ≤60), respectively. In this paper, we simulated the measurement errors with different degrees during the DT inspection by changing the corresponding test item value of the mother sample respectively. Three abnormal points with different abnormal degrees (mild, medium and severe) for each main item of the mother sample are constructed. Thus, a total of nine anomaly samples made totally for our study.
According to our investigation and suggestions of the inspectors, we constructed anomaly samples by making their corresponding item values approach the qualified limit value  gradually, as shown in Fig.3. For the i-th main item (attribute), the three samples with different abnormal degrees can be constructed as follows: 1) The value of the i-th item of the first anomaly sample (mid abnormal) is as follows: 2) The value of the i-th attribute of the second anomaly sample (medium abnormal) is as follows: 3) The value of the i-th attribute of the third anomaly sample (severe abnormal) is as follows: The three main attributes of the abnormal samples constructed are shown in Table 1.
An anomaly sample has only one attribute with abnormal, as nine samples are built based on the mother sample according to Table 1.

C. TRAIN DATASET AND TEST DATASET
As mentioned above, we have collected 106 samples and constructed nine abnormal samples. For unsupervised and semi-supervised anomaly detection algorithms, datasets are constructed respectively.

1) TEST DATASET FOR THE UNSUPERVISED ALGORITHMS
We used 106 samples plus one abnormal sample to build nine groups of test dataset. A total of 107 test samples are in each test dataset, while the abnormal sample is placed at the end, with the number of 107. Consequently, in test datasets 1, 2, and 3, the load loss attribute of sample 107 is abnormal. In test datasets 4, 5, and 6, the no-load loss attribute of sample 107 is abnormal. 1n test datasets 7, 8, and 9, the temperature rise attribute of sample 107 is abnormal.

2) TRAIN DATASET AND TEST DATASET FOR SEMI-SUPERVISED ALGORITHMS (ONE-CLASS SVM)
Ninety samples from 106 samples are selected randomly as the training set. The remaining 16 samples and nine abnormal samples are combined to form nine groups of test samples. Each test set has 17 samples with five-dimensional space, including one abnormal sample which is placed at the end of the group with the number of 17.

V. ANOMALY DETECTION OF DT INSPECTION REPORTS USING DIFFERENT ALGORITHMS A. SINGLE GAUSSIAN
Single Gaussian anomaly detection is applied on the load loss attribute of test datasets 1, 2, and 3, no-load loss attribute of test datasets 4, 5, and 6, and temperature rise attribute of test VOLUME 8, 2020     Table 2. Table 2 shows that the detection effect of single Gaussian algorithm is relatively well when Zthr = 3.0, comparing with other thresholds. The abnormal sample 107 can be detected accurately in datasets 5, 6, and 9 only. For datasets 2 and 3, although the abnormal sample 107 is detected, the normal samples 41 and 76 are detected incorrectly as anomalies. Moreover, no anomaly is detected in datasets 4, 7, and 8. In general, the anomaly detection effect on DT inspection reports using single Gaussian is poor.

B. MULTIVARIATE GAUSSIAN
To calculate the anomaly degree of each sample in the dataset using the multivariate Gaussian, parameters µ j and σ 2 j in Eq. (3) must be calculated firstly. Test datasets 1 to 9 have nearly the same mean and variance of each data attribute (load loss, no-load loss and temperature rise) because their first 106 data are the same, as shown in Table 3. In all nine datasets, the first 106 calculated values are the same, but the calculated value of the 107th sample is different. According to different attributes of their abnormal sample, we have shown the calculated results of nine datasets in three graphs, as shown in Fig 4. On coordinate 107, three values are distinguished by different colors. We assume that a maximum of 1% or 2% are implausible in DT inspection reports. Thus, the smallest two of the calculated values by Eq. (2) of 107 samples in each dataset are marked in red, which are regarded as the suspected abnormal samples. We can see that only in dataset 9(in Fig. 4[C]), the abnormal sample 107 with the highest degree of abnormality can be detected correctly. Thus, the anomaly detection using multivariate Gaussian on DT inspection reports cannot work correctly in this study.

C. LOCAL OUTILER FACTOR
According to the introduction of LOF in Section III.B, there is only one parameter, i.e., neighborhood width K , which decides the anomaly detection effect. Generally, K can take three representative parameters 5, 20 and 40. Considering that the LOF algorithm can detect anomaly in multi-dimensional data space, we used the LOF algorithm to detect anomalies in five-dimensional, three-dimensional, and one-dimensional space. Here, the three-dimensional space is the load loss, no-load loss, temperature rise. The implementation of the   one-dimensional detection method is similar to the single Gaussian method in Section V.A. The anomaly detection results are shown in Table 4, V and VI respectively. Table 4, 5 and 6 show that the LOF detection algorithm is relatively effective when it is working in one-dimensional data space using the parameter K = 20 or 40. The abnormal sample 107 can then be detected accurately in datasets 3, 4, 5, 6, and 8.

D. ONE-CLASS SVM 1) ALGORITHM IMPLEMENTATION AND MODEL PARAMETER SELECTION
The one-class SVM algorithm belongs to semi-supervised algorithms, which trains the model using train set, then, detects anomaly samples using the trained model. The algorithm flow chart is shown in Fig.5.   The programming of the OC-SVM algorithm is available in Scikit-Learn [25], a powerful machine learning library written in Python, which is used to implement anomaly detection evaluations. The model function is OneclassSVM (nu, kernel, gamma), where parameter ''nu'' represents the proportion of abnormal samples in the training set, and the range is (0, 1). In the DT inspection, we assume that 1%-2% of inspection reports have measuring errors. Thus, the parameter ''nu'' used 0.01 or 0.02 in our test. The parameter ''kernel'' represents the selected kernel function, which usually uses ''RBF.'' The parameter ''gamma'' is used to control the continuity of the boundary between normal points and abnormal points, which usually uses 0.015, 0.002 and ''auto.'' The training results with different parameters are shown in Table 7. Table 7 shows that the anomaly detection mode has the best effect when the model parameters are using nu = 0.02, kernel =''rbf''', gamma = 0.002.

2) TESTING
Using the OC-SVM model, nine testing datasets are detected in turn. In each testing, the distances from each data point to the boundary hypersphere in datasets are shown in Figures 6,  7, and 8. The red lines in the figures are anomalies that were detected. In Fig.6, we detected anomalies on datasets 1, 2, and 3, whereas the medium and severe abnormal samples in load loss attribute are detected correctly. In Fig.7, all abnormal samples in the no-load loss attribute can be detected correctly on datasets 4, 5, and 6. Fig.8 also shows that the mild abnormal sample in temperature rise attribute cannot be detected in dataset 7, but the medium abnormal sample in dataset 8 and the severe abnormal sample in dataset 9 can be detected correctly.

E. COMPARISON OF PERFORMANCE WITH DIFFERENT ALGORITHMS
Based on the testing results of the deferent anomaly detection algorithms, namely, single Gaussian, multivariate Gaussian, LOF, and OC-SVM, the comparison is shown in Table 8. The OC-SVM algorithm has the best performance of anomaly detection for DT inspection, compared with other algorithms. Only the mild abnormal data (load loss attribute) in dataset 1 and the mild abnormal data (temperature rise attribute) in dataset 7 are not detected, and the abnormal data in the other seven datasets are effectively detected, without any false detected. In dataset 1 and dataset 7, the value of constructed abnormal data are closed to the mean of the dataset, so, it is difficult to distinguish them using anomaly detection algorithms.

VI. CONCLUSION
This paper proposed using anomaly detection to flag the implausible reports in DT inspection. In this paper, we analyzed the DT inspection process and indicated that three test items of DT inspection, namely, load loss, no-load loss, and temperature rise, in which their probability of being wrong measured is larger than other test items. Thus, we simulated the measurement errors with different degrees during the DT inspection and constructed nine anomaly samples, i.e., three abnormal samples with different abnormal degrees (mild, medium and severe) for each of the three main items. Thus, test datasets are constructed for the anomaly detection algorithms. After comparing the detect results of single Gaussians, multivariate Gaussians, LOF and one-class SVM, we found that one-class SVM has the best performance of anomaly detection for DT inspection, compared with other algorithms. Furthermore, as a semi-supervised method, the one-class SVM only needs a small amount of train datasets but can achieve effective classification. Meanwhile, the oneclass SVM is easy to deploy in application. Thus, we suggested using one-class SVM algorithm to distinguish the abnormal samples (i.e., reports with measurement errors suspected) in the DT inspection reports, which can help inspectors to work correctly and effectively. At present, not many DT inspection reports were collected, and the anomaly samples used are constructed manually. We will try to verify the one-class SVM and other anomaly detection algorithms on larger DT datasets and real abnormal samples with the development of our study.