Localization with RSSI values for Wireless Sensor Networks : An Artificial Neural Network Approach

Collecting the data and forwarding it to its destination is an important function of a sensor network. For many applications, it is also very important to include the location information to the collected data. Localization techniques in wireless sensor networks (WSNs), which is a way of determining the sensor node locations can be utilized for obtaining such information. In this paper, we present an artificial feed-forward neural network based approach for node localization using the RSSI values of the anchor node beacons. The method was applied in a 5 x 4 m indoor environment with beacons installed at each of the corners. Five different training algorithms have been evaluated to obtain the training algorithm that gives the best results for this scenario. The multi-layer Perceptron (MLP) neural network has been obtained using the Matlab software and implemented using the Arduino programming language on the mobile node to evaluate its performance in real time environment. An average 2D localization error of 30 cm is obtained using a 12-12-2 feed-forward neural network structure. The method proposed can be used to implement a trained neural network using other programming languages on other platforms.


Introduction
Recent technological developments in the field of electronics and communication have resulted in the emergence of new applications in various fields drawing much attention from academia to the industries.One such field is the field of wireless sensor networks (WSNs) with prospective applications such as vegetation and environmental monitoring, military applications [1], object tracking (for example, tracking and monitoring patients and doctors in hospitals), search and rescue operations [2], and other industrial applications.Location based services, commonly known as localization (process of finding the position of the nodes [3]), are frequently required by many sensor network applications.For monitoring and recording a wide range of valuable information such as acoustic, thermal, visual, seismic or any other type of measured observation, it is often essential that the measured data is coupled with the location information in order to make the data significant.
Node localization is needed for reporting the origin of the events, assisting the group querying of sensors, routing, and for answering questions about the network coverage [4].Over the years, researchers have proposed various solutions [2,[4][5][6][7][8][9][10][11][12][13][14][15][16][17][18] to the problem of node localization.Depending on the application environment, tradeoff between the localization accuracy and the computational complexity of the techniques are mostly considered.It is impractical to note down or record the location of each of the sensor nodes during the time of deployment as WSNs typically consists of a large number of spatially distributed sensor nodes.On the other hand, the sensor nodes may be mobile and as such their location may change over time.Therefore, algorithms that automatically compute or determine the location of the sensor nodes are preferred.
Global Positioning System (GPS: [5,13]) can be used for accurate localization.However, this requires the sensor nodes to be equipped with GPS (an external hardware) and results in a costly solution in terms of cost and power consumption.On the other hand, GPS is not supported for indoor environments as it requires line-of-sight from the GPS satellite.Thus, this paper presents an artificial feed-forward neural network based 2D node localization scheme.It uses the received signal strength indicator (RSSI) values for approximating the spatial position of the sensor nodes.Sensor nodes are freely equipped with RF modules for wireless communication, therefore no extra hardware will be required.A set of data is required for training and testing the artificial neural network (ANN) [12,18].For this research, data was collected by measuring the RSSI values of the signals received from the four anchor nodes at each of the mobile node coordinates as shown in figure 1, r i = [x i , y i ] denoting the position of the i th reference point.The experimental measurements for this research were carried out in a research lab, which contained laboratory furniture and equipments such as tables, chairs and computers.The training data measurement structure consists of 9 x 11 measurement points (black points) as shown in figure 1, where the distance between the grid points is 0.50 m.For the testing dataset, measurements from the known positions as well as measurements from several unknown positions (indicated in green in figure 1) that are between the training measurement points are taken.

Implementation of the Proposed ANN Method
Neural networks are generally classified into two categories; the feed-forward neural networks and the feedback neural networks.A feed-forward neural network is one in which the outputs from one layer of neurons feeds forward into the next layer without skipping any layer and have no backward connection.In this paper, a multi-layer Perceptron (MLP) neural network (a feed-forward ANN) consisting of three layers has been employed using the Matlab software.The final structure selected (shown in figure 2) consists of a 12-12-2 structure having 4 input layer nodes, 12 nodes in the first and second hidden layers and 2 nodes in the output layer, trained using the Bayesian Regulation learning algorithm (refer to section 3).The inputs are the single instant of the RSSI values of the signals received from the anchor nodes, while the outputs represent the corresponding x and y coordinates of the mobile node.The hyperbolic tangent sigmoid ("tansig") activation functions are used for the hidden layers while the output layer uses a linear ("purelin") activation function.The structure of the dataset, which is a matrix containing the inputs (RSSI values) and the output coordinates are given below, where R ij denotes the RSSI values of the signal perceived from the j th anchor node, at the i th reference point while X i and Y i denote the x and y coordinates of the i th reference point.
The ANN obtained using Matlab can be represented by equation 1, which was implemented using the Arduino programming language on the mobile node for the node localization.In this relation, R is is the bias vector of th k node of th l layer.This method can also be used to implement neural network using other programming languages.

Results and Discussion
Supervised learning is required by ANNs and in this research five different learning/training algorithms: Levenberg-Marquardt (LM), Bayesian Regularization (BR), Resilient Back-propagation (RP), Scaled Conjugate Gradient (SCG) and Gradient Descent (GD) have been evaluated to get the best result.First, different ANN structures were tested with different number of hidden layers and nodes.From all the ANN structures evaluated, a 12-12-2 structure gave the most promising results considering the computational complexity and cost of the system.This ANN structure was then used to train the ANN using the above mentioned learning algorithms on a dataset containing 2375 data points (60% training, 20% validation and 20% testing) and the results are presented in figure 3. Further performance tests were carried out using 105 data points from unknown positions (see Figure 1).

Figure 3. The graph showing localization errors for different learning algorithms
The error distance is used to measure the performance of the network and the average error is calculated using equation 2.Where n is the number of samples in the data set, The BR learning algorithm takes about 751 seconds for the training process, which is quite high compared to the LM, RP and SCG learning algorithms while the GD learning algorithm takes the longest time.However, since offline learning is performed in order to obtain the ANN parameters the ANN network obtained from BR learning algorithm has been selected as it gave the lowest average error of 0.30 m on the test data of unknown positions compared to other methods that have been evaluated.Also, 99% of the time the error was less than 0.80 m for this selected ANN network.
In [9], a neural network approach is taken for 3D localization of the nodes using 4 anchor nodes having an average localization error of 0.4855 m for 2D movement.Ninety five percent of the mobile nodes had a localization error of less than 0.8 m.The authors used a 10-10-3 neural network structure with four inputs.A hyperbolic tangent sigmoid activation function was used for the first layer, the log sigmoid activation function for the second layer while the output used a liner activation function.A range free WCL for 3D WSN using Mamdani & Sugano Fuzzy Inference System (FIS) is presented in [10].In this method, the edge weights are computed based on the RSSI via the Mamdani & Sugano inference system having 121 anchor nodes and an average localization error of 3.0 m was achieved.Furthermore, neural networks generally provide higher accuracy than other techniques such as the Kalman filter [16].The MLP neural network is chosen due to its best trade-off between the accuracy and memory requirements among the other types of neural networks.The proposed ANN achieved a better localization performance compared to other methods mentioned above.On the other hand, the results presented herein are from actual experiments while the results of the related works mentioned in this section are from the simulation environment.

Conclusions
One of the major benefits for using neural network is that it does not require prior knowledge of the environment and noise distribution as the RSSI measurements are highly unstable and vary under environmental noise and mobility of sensor nodes.This paper presented an efficient 2D localization algorithm for WSNs using the artificial intelligence technique and achieved an average localization error of 0.30 m on unknown test data.For applications where online training will be required, the use of LM learning algorithm is recommended.

Figure 1 .
Figure 1.Experimental setup layout for data collection and testing

Figure 2 .
Figure 2. The proposed ANN having 4 inputs and 2 outputs

a 4
dimensional input row vector consisting of the RSSI values of the signals received from the four anchor nodes, coordinates of the mobile node at the i th test data set.