{'fraction_non_alphanumeric': 0.04200786982877805, 'fraction_numerical': 0.010847601829203446, 'mean_word_length': 4.402757828210285, 'pattern_counts': {'":': 0, '<': 0, '<?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}}
A Novel Low-Complexity Fault Diagnosis Algorithm for Energy Internet in Smart Cities

: The smart energy system, viewed as an “Energy Internet”, consists of the intelligent integration of decentralized sustainable energy sources, efﬁcient distribution, and optimized power consumption. That implies the fault diagnosis for a smart energy system should be of low complexity. In this paper, we propose a Strong Tracking Unscented Kalman Filter ( STUKF ) and modiﬁed Bayes’ classiﬁcation-based Modiﬁed Three Sigma test ( MTS ), abbreviated as SFBT , for smart energy networks. The theoretical analysis and simulations indicate that SFBT detects faults with a high accuracy and a low complexity of O ( n ) .


Introduction
The components a smart city include smart infrastructure, smart buildings, smart transportation, smart energy, smart health care, smart technology, smart governance, smart education, and smart citizens [1][2][3][4][5], among which the concept of smart energy can be viewed as an "Energy Internet" model [6][7][8][9][10][11]. The backbone of a smart energy system is the smart energy grid, the smart energy metering of which is an important component. For example, the smart meter records consumption of electric energy in certain time intervals and communicates that information to the utility for monitoring and billing. To ensure a green model for smart cities [12], minimal energy consumption is required. To serve such a purpose, fault diagnosis in green smart cities should be efficient in low complexity [13][14][15].
There exist many filter-based fault diagnosis algorithms specifically designed for nonlinear time-varying stochastic systems. In Reference [16], Ma et al. proposed a fault-related parameter estimation method based on a strong tracking filter for state assessment, as well as a logistic regression algorithm for root cause classification. In Reference [17], Daroogheh et al. designed a particle filter-based dual estimation strategy for both time-varying parameters and states. In Reference [18], Yin and Zhou proposed an intelligent particle filter to solve the problem of misleading state estimation due to the particle impoverishment. They designed a genetic-operators-based strategy to improve the particle diversity. Zhao et al. [19] developed an optimal unbiased finite impulse response filter, the estimator of which is used to minimize the mean square error subject to the unbiasedness constraint. In Reference [20], He et al. used the residual signal to detect sensor bias faults first and then employed residual analysis for faults isolation. Ge et al. [21] studied a performance comparison of the strong tracking filter and Kalman filter. In Reference [22], Zhao et al. designed an adaptive robust square-root cubature Kalman filter (CKF) with the noise statistic estimator to solve the decline or divergence problem of the accuracy of the CKF. Residual χ 2 test is a system-level fault detection algorithm [23] that can judge whether a set of measurement information in the Kalman filter system is effective in real time, based on which interactive residual fault detection method was proposed to identify both hard and soft faults, which are similar to the jump type fault and the soft fault, respectively. Huang and He [24] utilized two Bernoulli random variables to model the dead-zone effect. In addition, a Tobit Kalman filter is brought forward to generate a residual that can indicate the occurrence of an intermittent fault. The time-domain uncensored Kalman filter state estimation methodology is applied to address short circuit faults and transient load conditions [25]. On the other hand, researchers have been working on non-filter-based fault diagnosis algorithms for decades. Lau et al. [26] proposed a centralized diagnosis algorithm based on end-to-end transmission time, and then they employed the Bayes' classification to improve the diagnosis accuracy. In Reference [27], Nandi et al. used the Pearson test to find faulty nodes within a square grid based network. Gong et al. [28] proposed an optimal deducing model to locate faulty nodes based on the return message from the sink node. Jiang [29] developed a two-phase fault detection algorithm based on the majority voting. Panda [33] presented the design of a H ∞ sliding mode and an unknown input observer for Takagi-Sugeno systems to deal with the problem of inexact measurements of the premise variables. In Reference [34], a data-driven system based on PCA was designed to detect and quantify fluid leaks in an experimental pipeline.
Although these fault diagnosis approaches are able to detect certain industrial system faults, it remains a challenge to design a fault diagnosis model that meets practical production requirements [35][36][37]. In addition, how to accurately detect faults with a low complexity is still a challenge.

Our Contribution
In this paper, we propose a novel low-complexity algorithm named SFBT for fault detection in smart cities, which consists of a Strong Tracking Unscented Kalman Filter (STUKF), a Modified Bayes' classification algorithm (MB), and a Modified Three Sigma test (MTS), aimed to detect both of attenuation type faults and jump type faults. Besides, as a special case of the hypothesis test, SFBT can detect Byzantine faults [38]. Note that the message complexity of SFBT is O(n) such that the lifetime of a smart city network is extended. The details of our contributions are listed as follows: 1.
The STUKF, along with the MB, is applied to detect faulty cluster-heads in a centralized manner with a high accuracy; meanwhile, the messages exchanged are no more than O(n) such that the corresponding energy cost is reduced.

2.
We develop MTS to determine the faulty state of every cluster-member within each cluster of a faulty cluster-head, while the cluster with a fault-free cluster-head can easily make a decision by simply comparing the data between the cluster-head and cluster-members. By doing so, the diagnosis accuracy is increased significantly, and the message complexity, which is only O(n), implies that the energy cost is further reduced.
The rest of the paper is organized as follows. The system model and notions are given in Section 2. The strategies are elaborated in Section 3. Section 4 gives the theoretical analysis on the performance of the SFBT. The validation results are presented in this section, as well. We conclude this paper in Section 5.

System Model
In this paper, a fault diagnosis model that meets practical production requirements for smart energy network of smart city is considered. The discrete state-space model of which is given as follows: where k ≥ 0 is a discrete time variable, x ∈ R n is a state vector, z ∈ R m is an output vector, f : R n → R n and h : R n → R m denote nonlinear transition functions, Γ ∈ R n×n and v k ∈ R n and e k ∈ R m are uncorrelated, zero-mean, Gaussian white noises with covariance V k and E k , respectively. The meter of the smart energy network records consumption of electric energy in certain time intervals and communicates that information to the utility for monitoring and billing. Based on the normal and observed values of different meters, the data is modeled as a normal distribution with specific mean and standard deviation. Due to the harsh environment, each meter may malfunction with a probability p.
In this paper, we aim to solve the fault detection problem with a high accuracy and a low message complexity in a nonlinear time-varying stochastic system. All symbols and descriptions throughout the paper are given in Table 1.

The Proposed Strategy
We consider a clustered smart energy network in this paper. Instead of testing each meter, we perform a centralized testing on cluster-heads only. Then, the fault state of cluster-members can be verified by corresponding fault-free cluster-heads in a decentralized manner. To be more specific, the SFBT works in three phases. In the first phase, SFBT finds the Minimal Dominating Set (MDS) of the network such that each dominator serves as a cluster-head while the corresponding dominatees become cluster-members. During the phase two, SFBT applys both STUKF and MB to detect the faulty cluster-heads in a centralized manner. In the last phase, an MTS is developed to determine the fault state of each cluster-member for decentralized fault diagnosis.

STUKF-and MB-based Centralized Fault Diagnosis
In this section, we introduce the faulty cluster-heads detection algorithm, which is the second phase of the SFBT. Specifically, we apply an STUKF-based joint estimation method to predict the state and parameter of each cluster-head CH i first; then, the MB is adopted to find the faulty ones.

STUKF-based State Prediction
First, we introduce fault state related time-varying parameter θ(k). Then, joint estimation requires (1) to be rewritten as: . ( By applying joint estimation of states and parameters, faulty states can be detected. Then, we extent state, noise, and transition as follows: h e (x e (k + 1)) = h(x e (k + 1)) + θ(k + 1).

MB-based Faulty Cluster-Heads Identification
Once we obtainx e (k + 1), the MB is applied to find the faulty cluster-heads. First, we assume θ(k) obeys the normal distribution when the system is fault-free, which is where To be more specific, for eachθ i (k + 1|k + 1), the MB is applied to determine the faulty state of s i . The meter s i suffers from the parameter bias fault at k = τ, only if there exists a θ i such that H 1 holds. For the jump type fault, we need to obtain an accurate fault amplitude as follows. If there exists an integer M ∈ {0, 1, 2, · · · } such that for each then, at k = MT 2 + T 2 , the fault amplitude of s i is estimated to be Note that if a smaller ε i is chosen, then faults can be more accurately estimated, which requires much more time, and vice-versa.

Modified Three Sigma Rule-based Fault Diagnosis
In this section, the modified three sigma rule is introduced first, based on which the corresponding decentralized fault diagnosis is given.
The data x i sensed by s i can be measured by taking both estimated meanμ i and standard deviation σ i of the data collected from neighbors. Let t i represent the ratio between its deviation to the estimated mean and standard deviation as follows: According to the three sigma rule, if |t i | > 3, then s i is considered as faulty; otherwise, s i is fault-free. However, this rule is unable to detect faulty meters within a lower degree network. The reason is listed as follows. If there exist two suspicious meters s i and s j such that x i x j , then s j may be considered fault-free, which is called the "masking" [30]. To solve such a problem, the Median (Med) of the data and the Median Absolute Deviation (MAD) are applied, instead of the µ i and σ i , respectively. This is because the actual data value deviate from the faulty meter readings such that the Mdand MAD-based fault detecting schemes can achieve better accuracy in results. Then, we give the modified three sigma rule as follows.
For a data set x k = {x 1 , x 2 , · · · , x n k } sorted in an ascending order, we have The MAD is defined as follows: MAD(x 1 , · · · , x n i ) = Med{|x i − Md i |}. (18) In fact, only the normalized MAD, which is is suitable to replace Standard Deviation (SD) [30]. Then, the absolute error for the modified three sigma test is defined as follows: It is apparent that the modified three sigma rule defers from the original one only in the choice of the absolute error.
Next, we give the corresponding decentralized fault diagnosis algorithm as follows: Step 1: For each cluster C i with a fault-free cluster-head CH i , if |x j − x i | ≤ η, then s j ∈ C i is fault-free; otherwise, s j is faulty.
Step 2: For each cluster C j with a faulty cluster-head CH j , the MTS is applied to C j = C j \{CH j } such that the fault state of each cluster-member within C j is detected.
By doing so, we can determine the fault states of at least |MDS| (1 − p r ) meters, where represents the maximum degree of graph G. The theoretical analysis on the diagnosis accuracy and message complexity is given in the next section.

Theoretical Analysis
In this section, we analyze the performance of the SFBT in terms of: (I) Detection Accuracy (abbreviated as DA, which is the ratio between number of faulty meters detected as faulty and the total number of faulty meters); (II) False Alarm Rate (abbreviated as FAR, which is the number of fault-free meters detected as faulty to the total number of fault-free meters); (III) False Positive Rate (abbreviated as FPR, which is the ratio of the number of faulty meters detected as fault-free to the total number of faulty meters); and (IV) message complexity.
Let p r be the probability of a meter being faulty, p be the probability that a faulty meter detected as fault-free, and p denote the accuracy of the SFBT, respectively. Then, the following three theorems hold.

Theorem 1. The DA of the proposed algorithm SFBT is
Proof. The SFBT detects faulty meters in two phases. In the first phase, there are up to |MDS|(1 − p r ) fault-free cluster-heads detected along with |MDS|p r faulty ones. That implies there are at most |MDS|(1 − p r ) p r faulty cluster-members correctly diagnosed within corresponding clusters. According to the modified sigma rule, it is apparent that, if t r i ≤ 3, then the detection accuracy is according to the DA of the three sigma test given by Panda [38], which is That suggests we can correctly detect |MDS|p r faulty cluster-members. Therefore, the DA of SFBT is deduced as n [40], n denotes the number of meters, and the minimum and the maximum degree of graph G is denoted by δ and , respectively. Theorem 2. The FPR of the algorithm SFBT is Proof. Similar to the proof of Theorem 5.1, the SFBT can correctly detect up to |MDS|p r faulty cluster-heads. With the help of fault-free cluster-heads, there are at most |MDS|p r (1 − p r ) faulty cluster-members detected as faulty ones. According to literature [38], the FPR of the three sigma test is Therefore, we can deduce that the FPR of the SFBT is

Theorem 3. The FAR for the algorithm SFBT is
Proof. Similar to the proofs of previous theorems, there are up to |MDS|(1 − p r ) fault-free cluster-heads correctly detected by the SFBT. That implies the fault states of corresponding cluster-members, which are as many as |MDS|(1 − p r ) (1 − p r ) meters, are easily verified. The FAR of the three sigma test is given in Reference [38] as follows: There is no doubt that the FAR of the SFBT is

Theorem 4. The message complexity of the algorithm SFBT is O(n).
Proof. Since the SFBT is a two-phase strategy, we analyze the complexity of each phase to prove this theorem. Since the centralized diagnosis part of the SFBT requires sampling, the corresponding message complexity depends on the number of sample, which equals to the data window N 1 . In fact, the data window can be chosen as a constant such that the number of messages exchanged is less than |MDS|N 1 . That implies complexity of the centralized part of the SFBT is O(n). On the other hand, for an MTS-based strategy, each fault-free CH i obtains the broadcasting data of every cluster-member, while meters within each C i of a faulty CH i broadcast data to each other. That implies the complexity of the decentralized part of the SFBT is O(n). Therefore, the message complexity of the SFBT is no more than O(n).
It is obvious that SFBT is low-complexity when compared with contemporaneous fault diagnosis algorithms.

Validation Experiment
The performance of the SFBT is given in this section. First, the diagnosis accuracy for faulty cluster-header detection utilizing STUKF and MB only is validated through experiments. Then, we compare the SFBT with the existing DFD [30], Jiang [28], and DSFD [38] in terms of detection accuracy (DA), false positive rate (FPR), and false alarm rate (FAR), respectively.
The resistor of a meter easily suffers from the jump type fault. Suppose the resistor gets faulty at k = 1000. Let θ 0 = 10 kΩ, σ 2 θ 0 = 1000, N 1 = 20, β θ = 4000, ε = 0.1, and T 2 = 50. The capacitor is subject to the attenuation type fault, which is a case of the incipient fault. Now, we show the proposed strategy can detect the attenuation type fault. Let θ 0 = 1000 pF, σ 2 θ 0 = 0.1, N 1 = 40, β θ = 500, 000. Suppose the degradation of the capacitor begins with θ(k + 1) = θ(k)−1 2 at k = 600. Figures 3 and 4 show that, the attenuation type fault has been detected at about step = 1110 with the magnitude about 235 pF. That implies the detection accuracy is 1 − 235 1000 = 97.65%.  In Figure 5, it is clear that the detection accuracy of each strategy drops with the increase of the fault probability. However, the SFBT achieves higher detection accuracy than the others. Although the false alarm rate and the false positive rate increase with the fault probability (see Figures 6 and 7), the SFBT still outperforms baseline approaches.  To sum up, the SFBT performs better than DFD [41], Jiang [29], and DSFD [30] in terms of detection accuracy, false positive rate, and false alarm rate, respectively. The reason for that is the SFBT employs fault-free cluster-heads, which are located by the strong tracking UKF and the modified Bayes' classification algorithm, to detect the fault states of cluster-members through the modified three sigma test.

Conclusions
The optimized power consumption for a smart energy system of a smart city is crucial. Although a variety of fault diagnosis algorithms have been developed, how to efficiently detect faults with low complexity poses a great challenge. To this end, we propose the SFBT that works on a clustered network. It first applies a strong tracking UKF (STUKF) and a modified Bayes' classification algorithm (MB) to detect fault-free cluster-heads in a centralized manner. Then, a decentralized modified three Sigma test (MTS) is developed to identify faulty cluster-members to overcome the "masking" problem within the cluster with a faulty cluster-head. Besides, a faulty-free cluster-head can detect any faulty cluster-member by simply comparing the data of its own and the one of the cluster-member. The theoretical analysis and experiment results indicate that the SFBT achieves higher diagnosis accuracy over some contemporary strategies with a complexity of O(n).
In fact, each faulty free cluster-head detected by the SFBT is only one hop away from corresponding cluster-members. That suggests data collected by the cluster-head do not differ much from that of cluster-members, which makes the three Sigma test work. However, by doing so, more cluster-heads are required. Thus, our future work includes how to detect faulty cluster-members at least two hops away with a complexity no more than O(n).