Distributed Fault Detection for Wireless Sensor Networks Based on Support Vector Regression

1 Jiangsu Key Laboratory of AgriculturalMeteorology, NanjingUniversity of Information Science & Technology, Nanjing 210044, China 2Department of Computer & Software, Nanjing University of Information Science & Technology, Nanjing 210044, China 3School of Information and Safety Engineering, Zhongnan University of Economics and Law, Wuhan 430073, China 4COMSATS University Islamabad, Wah Campus, Pakistan


Introduction
Wireless sensor networks (WSNs) consist of a large number of sensor nodes, which are small and low-cost.WSNs are used to sense physical conditions, collect and process information about the objects in the coverage area, and send information to the observer for further processing and analysis [1][2][3][4].To date, WSNs have been widely used in many critical fields, such as environmental surveillance, emergency navigation, traffic monitoring, and industrial control [5,6].Because of the limited computing capacity and energy of wireless meteorological sensor network nodes as well as the complex characteristics and real-time data of meteorological information, unexpected faults appear in nodes after long run times [7].Therefore, detecting sensor nodes with faulty readings, which can greatly improve the performance of the wireless sensor network, is necessary.
Rajasegarar et al. proposed a distributed, nonparametric anomaly detection algorithm that identifies anomalous measurements at nodes based on data clustering [8].They use a hyperspherical clustering algorithm and the k-nearest neighbor scheme to collaboratively detect anomalies in wireless sensor network data.A localized fault identification algorithm in wireless sensor networks is studied by Ding et al. [9]; this is a distributed fault detection algorithm, where each sensor node compares its own sensed data with the median of neighboring data to identify its own fault status.The performance of localized diagnosis algorithm is limited due to the uneven nature of the nodes in wireless sensor networks.Daniel et al. proposed a classification based voting method for anomaly detection [10] that uses five different classifiers to detect anomalies with reliable estimations to replace the affected measurements.This method fails in cases where a large dataset is considered.
The literature also indicates that the fault recognition rate of current fault detection algorithms in WSNs decreases with high failure rates.Many fault detection methods exploit the difference between the readings of neighbor nodes because a 2 Wireless Communications and Mobile Computing sensor node's readings are similar to a neighboring node's data in many applications.However, most readings cause excess overhead.This paper proposes a new approach, distributed fault detection for wireless sensor networks based on support vector regression, which can improve the accuracy of the fault diagnosis algorithm.It uses weather data from sensors in WSNs as the data set and is combined with the neighbor collaboration method to createset up a new support vector machine model forecast system.The proposed algorithm can save the overhead due to the frequent interactions between nodes.It makes better use of the characteristics of a meteorological sensor network to improve the fault diagnosis accuracy, which is more suitable for sparse WSNs, even when the failure rate is very high.The contributions of this paper are summarized as follows: (i) Aiming to solve the problems of the low accuracy and high complexity of the existing fault diagnosis methods used for wireless meteorological sensor networks, a fault diagnosis method based on support vector regression and neighbor cooperation is proposed.
(ii) The proposed model uses the residuals generated by the redundant spatiotemporal meteorological values between different sensor nodes and neighbor cooperation methods to improve the accuracy of fault diagnosis algorithms and save the overhead generated due to the frequent interactions between nodes.
(iii) The experimental results show that the accuracy of the proposed algorithm is greater than 87% and that the accuracy of fault detection is improved by nearly 13%.The proposed algorithm has high fault detection accuracy and a low false alarm rate, and it reduces the node traffic.It is more applicable for wireless weather sensor networks with a sparse node distribution and high failure rate.
The remainder of this article is organized as follows.Section 2 presents related works on fault detection for WSNs.Section 3 introduces distributed fault detection algorithms based on support vector regression and multisensor cooperation.Section 4 presents the experimental settings and evaluation metrics and theoretically analyzes the performance of the presented methods.Finally, this article is concluded in Section 5

Related Work
The fault detection of wireless sensor networks can be divided into centralized detection and distributed detection, according to the tasks.In general, for a low information flow, centralized fault detection technology is simple to implement and easy to use, and it can effectively locate the failure node; this technology is suitable for smallscale meteorological sensor networks.However, its shortcomings are even more obvious: its main problems are the central node bottleneck, near-central node heat issues, delays, wireless channel congestion, and poor system scalability.Therefore, for meteorological sensing networks with large networks and limited available resources, to reduce the system energy consumption and ensure the system reliability, the distributed detection method is generally considered.
The distributed fault detection algorithm mainly adopts the idea of local decision-making.The node compares the local collected weather information and the information collected from neighboring nodes; the algorithm finally determines whether have a fault.The distributed fault detection method does not need to send all of the information to the central node.Instead, each node in the sensor network completes the fault detection task in the network either independently or partially.In the distributed fault detection algorithm, the node can perform more decisions locally, thus further reducing the amount of traffic generated by the data sent to the central node.This also balances the amount of message interaction in the network and reduces both the energy consumption and network congestion; furthermore, the life of the entire network is extended.
Distributed fault detection is applicable to most meteorological sensor networks and is the future trend of fault detection [11][12][13][14][15][16].Reference [17] proposed a typical distributed fault detection (DFD) algorithm.The DFD algorithm computes the similarity of the data sensed by neighboring nodes concurrently to determine the initial state of the node.The state and neighbor nodes test each other to determine whether a node is faulty and spreads the diagnosed result to its neighboring nodes, but the DFD method must cause the node to communicate with neighboring node three times and then determine the state of the node, resulting in a large amount of data communication; therefore, the DFD algorithm must consume large amounts of energy.
In recent years, many scholars have proposed a number of improved distributed fault detection methods based on the DFD algorithm [18][19][20][21][22][23][24][25][26][27].References [28][29][30][31][32] show that when the number of neighboring network nodes is small and the probability of node failure is large, the DFD algorithm performance will decrease sharply because the DFD algorithm judges too harshly if the node is normal condition.Therefore, [32] improved the DFD algorithm and modified the judgment conditions of the final state of DFD algorithm.References [33,34] proposed a distribution adaptive sensor network fault detection mechanism based on the DFD algorithm.They further introduced the concept of the reliability level, based on the credibility of the neighboring node, which selects the trusted node and compares the data from the local node to determine the node status.References [35,36] proposed a fault detection mechanism in which historic data and neighbors cooperate and fuse.First, a root node is selected.If the root node is normal, it is used as a reference node when the network node status is judged; if the root node is a fault, the root node is reselected from the remaining nodes, and the state is determined until the reference node is found.Then, the reference node is used to make a decision on the state of the neighbor node.If the neighboring node is normal, it is used as a reference node.The neighbors are then determined; if the neighbor fails, it cannot be used as a reference node.To complete the determination of the status of all network nodes, the fault detection algorithm is used again on the nodes that still have an unknown status.
In addition to the fault detection method based on the voting mechanism of neighbor nodes, Min D proposed a median-based fault detection algorithm that used the data collected by neighboring nodes to sort the data sequence and obtains intermediate data from the sequence.The obtained value compares the value with the data collected by the node.If the difference exceeds the threshold, the node fails.Reference [30] proposed a method for distributing the detection tasks for the typical clustering structure of a sensor network.The fault detection method in each unit cluster uses the periodic data exchange between cluster heads and neighboring cluster head nodes until cluster head fault detection is completed.Within a cluster, the cluster head node is responsible for periodically broadcasting, detecting, and locating faulty nodes.
Currently, most fault detection technologies used in meteorological sensor networks are based on the distributed method.The distributed fault detection algorithm distributes the computational cost over all of the nodes in the network, and the decentralized features make it self-organized, so the characteristics of improving resource efficiency and facilitating implementation are very suitable for the application requirements of a meteorological sensor network.However, on the one hand, the distributed method based on the voting strategy often has a large amount of additional communication overhead; on the other hand, in a network with a low node distribution density and a high failure rate, the performance of the traditional distributed methods is greatly reduced.In a large-scale meteorological sensor network, the traditional distributed fault detection method has the problem that its detection performance decreases sharply and its energy consumption increases.
The SVM classifier has gained popularity due to its optimum solution and its simple numerical comparison for data classification.Several SVM-based approaches have been proposed [37][38][39][40] for anomaly detection in WSNs.Based on the above analysis, the fault detection rate of the traditional fault detection algorithm decreases rapidly when the fault detection rate is high.When implementing the traditional distributed algorithm, the high performance of the detection is achieved by using multiple methods of communication between neighbor nodes.With a large amount of extra overhead, a distributed node fault detection algorithm based on support vector machine regression prediction model is proposed.Through the meteorological sensors carried on the nodes of the wireless weather sensor network, the meteorological elements are collected to construct a support vector machine regression algorithm prediction model, and residuals are generated using redundant information concerning the time and space of meteorological element values between different sensors in a node.In combination with neighbor cooperation methods, the accuracy of the fault detection algorithm is improved, and the overhead generated by the frequent interaction between nodes is saved.Thus, the characteristics of meteorological sensor networks are better used to improve the fault detection accuracy, thus making the algorithm more suitable for wireless weather sensor networks with sparse nodes and high sensor failure rates.

Distributed Fault Detection Based on Support Vector Regression
3.1.Support Vector Regression.SVR (Support Vector Regression) was originally introduced under linear and divisible conditions and was developed as an effectual way to solve prediction problems [41].Consider a set of training data (  ,   ), ( = 1, 2, . . ., ), which are historical perception data from sensors, where n is the total number of data points.The original inputs are first mapped into a highdimensional feature space by nonlinear mapping , and the linear regression function is produced: where the dimension w is the dimension of the feature space.
The resolutions of w and b are transformed into a convexity quadratic programming problem: SVR can solve small sample problems and has good generalization ability when using the principles of structural risk minimization.The constant C>0 is a punishment coefficient.  and  *  are the slack variables.Meanwhile, the Lagrangian multipliers   and  *  are introduced to analyze a quadratic programming (QP) problem with linear state inequality constraints.Then, the above optimization problem is transformed into its dual form: where (  ,   ) is the kernel function [42].By using the kernel function idea, this theory can change a problem in nonlinearity space into one in linearity space to reduce the algorithm complexity.The regressive function is denoted as follows: where SV is the support vector set.
Wireless Communications and Mobile Computing  2 builds the SVR prediction model with a sample that consists of the temperature and voltage.The current moment for k is set, and the sample consists of past continuous data as follows:

Multisensor
where   ,  −1 , . . .,  −+1 are denoted as the voltage from moment k to k-l+1.The estimated value T  from  2 is a function of temperature and voltage at the past moment: We produce two estimated values of the temperature T and T  at moment k after training the SVR forecasting model and compare the results with the real data from the temperature sensor to produce the residual sequence: The prediction model can accurately output the temperature values T and T

󸀠
, according the effective history data collected by the sensors.If the data from the temperature sensors cause an exception at moment k, the residual  1 and  2 are above the threshold value  1 , and  3 basically shows no change.We update the predictions with the actual data if the residual of the parameters from the nodes is less than the threshold parameters.The forecast model prepares the next prediction.

Distributed Fault Diagnosis Algorithm.
In WSNs, because of the time-space continuum of the environmental factors and the densely deployed nodes, a node has the characteristic of spatial similarity with its nearby nodes; that is, the nearby nodes are likely to have similar measurements.Nodes in the monitoring area will affect the accuracy of the fault diagnosis algorithm when an event occurs.As a result, the algorithm given in this paper is combined with the fault diagnosis and neighbor coordination methods and introduces the credibility evaluation mechanism.The credibility of nodes comes not only from their own sensory information but also from the judgment of the sensory information by the neighbor nodes, which effectively eliminates the influence of the fault node.We consider that N sensor nodes are randomly placed in a unit square field.Without loss of generality, we suppose that the location of each node is known and that all nodes have the same communication radius R. The average number of nodes within a transmission range is the node density used to illustrate the number of neighboring changes.Each node can communicate with other nodes by one-hop or multihops.Nodes are assumed to be neighboring nodes if they are in each other's coverage radius.Each node periodically broadcasts its measurements or decision, such as temperature, humidity, air pressure and wind speed, to all its neighbors.The WSNs are modelled as the system graph G(V,E), where V represents a set of nodes in WSNs and E represents a set of logical links between nodes.Let (  ,   ) denote the distance between node   and node   ; then, E is based on the following definition: The nodes within the transmission range of node   belong to the neighborhood (  ), (  ) ⊂ .We apply fault detection to node   at each t timestamp.The measurement of node   at t time is denoted as    .Assume that the neighborhood (  ) of node (  ) consists of Negi sensor nodes; that is,   ∈ (  ),  = 1, . . .  .
First, we use the trust level   for the node   ∈ (  ).Each node has the same trust level at first, and we set   =   .We adjust the trust level of nodes within the neighborhood by using the fault diagnosis mechanism based on support vector machine regression.If the meteorological elements are above the threshold value, then   =   − 1.
Otherwise, we transmit the predicted value x +1 and the trust level   to node   .We denote the weight value for the fault detection caused by the sensor data of the neighbor node   as   : where SUM is the sum of the trust levels of all nodes within the neighborhood.
For node   , we use the fault diagnosis mechanism based on support vector machine regression to get the prediction data of the next moment.We calculate the failure level indicator by the space-time correlation between nodes in wireless sensor networks: If   >  2 , the trust level   = 0, and node   fails.Otherwise, the predicted value is updated by the actual value and the forecast model to prepare the next prediction.

Simulation
We experiment in MATLAB to assess the performance of the proposed approach.The WSNs contain 200 nodes in a square region of 30 × 30 units.Each sensor is randomly placed in a unit grid.The measurements of the nodes in the normal area are subject to a Gaussian distribution.The data from Intel lab are used in the experiment [43], including temperature, humidity, and voltage, as the experimental data.We use the tile radial primary kernel function and set    = 10,  1 = 0.5,  2 = 0.375.The performance of the proposed DSFD (Distributed SVR Fault Detection) algorithm is evaluated and compared with the existing DFD algorithm in [17] in terms of the detection accuracy (DA) and false alarm rate (FAR) in the network.All experiments are repeated 100 times, and data for analysis are the averaged to ensure the statistical significance of the experiments.To assess the effect of faulty node identification, two indicators are usually employed: detection accuracy and false alarm rate.
4.1.Detection Accuracy.Detection accuracy (DA) refers to the ratio of the number of correctly identified faulty nodes to the total number of actual fault nodes: where F is the set of fault nodes which the algorithm has detected and Q is the set of actual fault nodes.We compare two algorithms in terms of detection accuracy under different sensor density configurations in Figures 1 and 2, respectively.When the failure rate is lower than 25%, the fault detection precisions of the two algorithms are greater than 91%.With an increase in the node failure rate, the fault detection precisions of the two algorithms are decreased, but the DSFD algorithm has a higher fault detection accuracy than does the DFD.However, we can see that with a decrease in node density, the performance of each algorithm improves.Taking Figure 1 as an example, when the sensor fault probability is higher than 40%, the fault detection accuracy of DSFD algorithm is still over 87%, which is an improvement of 13% over the DFD algorithm.The DFD algorithm first determines the node's initial state by comparing the data from its neighborhood nodes with itself; then, the status of the node is determined according to the initial state of the node and the adjacent nodes.This might occur because when the fault rate is high and the number of neighbors is large, the misdiagnosis rate of DFD is high.The DSFD algorithm constructs a support vector machine regression forecasting model with historical data and accurately determines the fault node.The DSFD adds the reference objects according to the correlation between multiple sensors on nodes to reduce dependence on the neighbor nodes.

False Alarm Rate.
The false alarm rate (FAR) refers to the ratio of the number of normal nodes that are mistaken as fault nodes to the total number of normal nodes: where N is the total number of nodes in the WSNs.Figures 3 and 4 show the false alarm rate against the sensor fault probability for different average number of neighbors.They indicate the performance of each algorithm at densities of 5 and 10.From the two figures, we can see that, with an increase in the sensor fault probability, the false alarm rate of each algorithm increases.The higher the fault probability is, the higher false alarm rate is.As Figure 3 shows, the false alarm rate of DSFD is 14.7%; it is still below 7% when the sensor fault probability is 40%.This occurs because the DFD algorithm diagnoses all nodes in the monitoring field and uses many sampling times by comparing the sensed data from neighbor nodes.Many of the sensor tests of good sensors are likely faulty, so these good sensors are then diagnosed as faulty sensors.However, the DSFD algorithm not only uses the collaborative operation of neighboring peers but also combines the support vector machine (SVM) regression algorithm with the information redundancy between the sensors in the wireless sensor network.The proposed DSFD algorithm avoids the misdiagnosis caused by the number of neighbor nodes and the incorrect data from neighbor nodes, thereby achieving high detection accuracy.

Conclusion
In this paper, we modelled and analyzed a fault diagnosis mechanism based on support vector machine regression among sensor observations in wireless sensor networks according to the redundant information of meteorological elements collected by multisensors.The fault prediction model is built using a support vector regression algorithm to achieve residual sequences.The proposed algorithm outperforms previous DFD in terms of faulty sensor detection accuracy and false alarm rates.The fault detection algorithm achieves high detection accuracy and low false alarm rates, which are more suitable for sparse WSNs, even when the failure rate is very high.

Figure 1 :Figure 2 :
Figure 1: Fault sensor detection accuracy when the average degree is 5.

Figure 3 :
Figure 3: Fault sensor false alarm rate when the average degree is 5.

Figure 4 :
Figure 4: Fault sensor false alarm rate when the average degree is 10.
Cooperation.A node in a WSN, which has multiple sensors, collects different types of environmental information, such as temperature, humidity, light, and carbon dioxide concentration.Some of the types of environmental information from the same node have close correlations.In addition to the node collection of meteorological elements, voltage is an important parameter in fault diagnosis.The node voltage has an obvious effect on the temperature and other meteorological elements.Therefore, the proposed algorithm produces multiple estimates by setting up a multiple SVR forecast model.These estimates are compared with the residual sequences, which come from meteorological elements.For temperature, humidity, and voltage, we build two SVR prediction models,  1 and  2 , with three types of data, which have a redundant relationship in time and space. 1 builds the SVR prediction model with a sample consisting of temperature and humidity.The current moment for k is set, and the sample consisting of past continuous data is as follows: (6) −1 ,  −2 , ...,  − ,   ,  −1 , ...,  −+1 )(5)where  −1 ,  −2 , . ..,  − are the temperature from moment k-1 to k-l and   ,  −1 , . ..,  −+1 are denoted as the humidity from moment k to k-l+1.The temperature values from moment k-2 to k-l and the humidity values from k-1 to k-l+1 are used as the input samples; the temperature value at k-1 is used as the output sample.The estimated value T from  1 is a function of temperature and humidity at the past moment: T =  ( −1 ,  −2 , . ..,  −+1 ,   ,  −1 , . ..,  −+2 )(6)