IntroductionA network of small,low cost sensor nodes with basic functionality, spread out in an area forsensing specific parameters of the environment and with wireless links isgenerally termed as a Wireless sensor network (WSN). Each node in a WSN usuallyconsists of an independent power source, a sensor unit, a transceiver unit anda processing unit making each wireless sensor node autonomous. This enableslarge scale distribution of these nodes over larger areas for better and fasterdata gathering. Recent technological advances have made manufacture of small,low cost sensors nodes technologically and economically feasible 1. Characteristics of WSN, like mobility of nodes, ease of additionor removal nodes to the network, heterogeneity of the nodes and ability to copewith node failure, have ensured a wide range of application of wireless sensornetworks. Precision Agriculture,Environmental Monitoring, Vehicle Tracking, Health care Monitoring, SmartBuildings, Military Applications, Animal Tracking are few applications of WSNs2. The information gathered by the wireless sensor nodes, in certainapplications, becomes useful only when locations from where the data has beencollected is known.

Hence, Localisation of wireless sensor nodes is equallyimportant as sensing, especially for applications like tracking intruders inbattlefield, locating objects in building, self-driven cars and emergencyresponse applications 3. Severalalgorithms have been developed for localization of nodes in a WSN. GlobalPositioning System (GPS) is currently the most commonly used positioningsystems in the world 4. However, GPS cannot be used in applications where thewireless sensor nodes are small and it is not feasible to configure each nodewith GPS and in applications where the nodes are spread out in indoors and areheavily dense. Hence many other algorithms are used for such situations. Thesealgorithms can be broadly classified into Range based and Range free algorithms.Time of Signal Arrival (TOA), Time Difference of Signal Arrival (TDOA), Angleof Arrival and Received Signal Strength Indicator (RSSI) are few range basedlocalization algorithms.

RSSI based localisation is more popular because it issimple and does not require any sophisticated hardware 5. Unlike in outdoor,localization parameters would not remain constant in complex indoorenvironments. The wireless signal is more severely affected by multipath error,diffraction, obstacles, the direction of antennas and other factors 6.Because of these, a huge amount of noise would be added to RSSI and would resultin error in localization. To reduce the error, feedback error control usingmultiplicative distance-correction factor, Time Window Statistics, UWB Ranging and other techniques are used789. However, all these techniques increase the computational timerequired for localization.

In this paper, we discuss how the error in localization of nodes can bereduced with help of neural networks. We first train the neural network in ourenvironment and then use this trained neural network for error correction. Wealso compare the performance of localization with different parameters. RSSI Estimating distance from RSSI RSSI based localizationalgorithms estimate the distance of a node from a given node, which transmits asignal, by measuring the power of the signal received by the receiving node.The node which transmits the signal are static and are aware of their location.These nodes are called anchor nodes or beacon nodes. If the power received by anode which is at a given distance from an anchor node is known, then the powerat a distance d is given as follows3: Where Pr is the power received at adistance d from the anchor node, A is the power received at a unitdistance from the anchor node and npis the transmission factor whose value describes the environment andis different from place to place. The parameters A and np areconstant over a given area for outdoor environment, but they vary considerablyover short distances in an indoor environment.

Hence, for indoor localization,the environment has to divided into smaller areas over which the parameters A and np can be considered constant. Each area would have adifferent value for the parameters and can be estimated experimentally 4.Once the parameters A and np are known, the distance ofa node from the anchor node by the following equation: Predicting the location with the measured distances. To predict thelocation of a node, in a two-dimensional area, distances has to be measuresfrom at least three anchor nodes which do not fall in the same line. With thelocations of these anchor nodes, location of the node is the point ofintersection of the three circles, drawn with the anchor nodes as centre andradius equal to the distances of the node from the anchor nodes. If (xa, ya), (xb,yb) and (xc, yc) are the coordinates of three anchor nodes and da, db, dcare the distances of a node from these anchor nodes respectively, then thecoordinates of the node (x, y) is estimated by solving the equations: In case of athree-dimensional localization, distances of the node from 4 anchor nodes,which do not fall on the same plane has to be measured. Location can beestimated by finding the intersection of the four spheres formed from theanchor nodes Considering effects of noise. Due to the presenceof noise in the signals, randomness in the indoor environment and other factorsintroduce error in the distances measured by the nodes and the location datasent by the anchor nodes.

Due to these errors, the constant distance circlefrom the anchor nodes a, b and c may not meet at a common point as shown infig1. Which means the equations may not have a single point solution. Hence, weestimate the location to the point of intersection of lines l, mand n, which are lines obtained byconnecting the points of intersection of a pair of circles. Equations of l, mand n can be obtained by taking thedifference of equations 4 3, 5 4 and 3 5 respectively. Solving the so obtainedequations would give the estimated location of the node 10.

Neural network Neural networks, usuallyhas a finite number of discrete outputs, even when the input is continuous. Thenumber of outputs is equal to the number of nodes in the last layer. But forcorrecting the error in localization, the output has to be continuous. Usingneural networks with regression helps us to obtain a continuous output from theneural network. In neural networks with regression, the values in the finallayer is fed into another layer with a single node, after being multiplied bythe weights.

The value of this node is treated as output, having continuous values. This network can betrained and the neuron values and connection weights can be manipulated duringthe training phase. Once trained, these networks can be used to obtain requiredresults Error correction using neural networks Presence of noise, Randomness of the environment, obstaclesand other factors make sure that in an indoor environment the localizationresults are erroneous most of the time. Using neural networks, the error in thelocalization result can be reduced drastically. In this paper, we build asimple feedforward neural network with regression. We train the network byfeeding it with inputs and desired outputs. These input output data are resultsof RSSI based localization.

Once trained, Results of localization can be passedthrough this network to get highly accurate results. A feedforward network is initializedwith required number of hidden layers, inputs and outputs. The weights of linksin the network are initialized to any random value. The outputs of this networkare connected to a single node for getting a continuous output. For training the neural networks,few wireless sensor nodes are uniformly spread in the environment, placed atknown locations. Localization results of these nodes are computed. These computedvalues are given to the neural network as input and the corresponding actuallocations are given as desired outputs. An input to the network propagates in theforward direction and produces an output.

This output is compared with thedesired value and the error in the computed value is recorded. With the desiredoutput, the neural network is traced back manipulating the weights of the intermediateconnections so that the desired output is obtained for that particular input. Thisprocess is continued for all the other values in the training data set,completing one epoch. If the average error is greater than a prefixedthreshold, another epoch of training occurs, till the average error is atdesired levels. After training, the neural network is tested and validated withtwo other sets of data. After training, testing and validation the neuralnetwork is ready to be deployed.

The results of localization arefed into this neural network. The output would be the error corrected output.The amount of error correction depends on the number of hidden layers andnumber of training nodes dedicated.

More the number of training nodes, betterwould be the performance of the neural network. However, the training timewould increase proportionately with the number of training nodes. A trained neural network would help in errorcontrol without any additional requirements until there is drastic change inthe environment. Under such circumstances the network has to be trained againfor correct functioning.

Simulation and Results To demonstrate andverify the usefulness of neural networks in error control, simulations werecarried out in MATLAB and the results would be discussed in this section. The simulation area isa 10m by 10m square, with four beacon nodes at four corners. Wireless sensornetworks would be randomly distributed within this area.

Noise is added to theRSSI signal with SNR 20dB. The A and np values are taken as -20dBand 1.6 respectively. The effects of obstacles in indoor environment issimulated by adding the errors to anchor nodes.

Training nodes are deployed fortraining the networks which would be used for error correction in nodes. Fig.3 shows theaverage error on localization, without and with error correction using neuralnetworks. 10 nodes were simulated and error correction was made with the help ofa network trained with 100 nodes. It can be seen that, with help of neural networks,the error can be reduced to a level where it can be negligible. In Fig.

4 thevariation in the average error with the number of training nodes is shown. Wecan see that with the increase in the number of training nodes, the average errorreduces. Fig.5 shows thatvariation in average error with the number of hidden layers in the neuralnetwork. The average error first decreases then increases slightly and thenreduces again.

Fig.6 Shows the simulation results. Conclusion In this paper, wediscussed how neural networks can used to improve the performance of indoorlocalization algorithm based on RSSI. We discussed how RSSI values can be used todetermine the coordinates of a node, sources of errors during estimation andhow neural networks are used to reduce this error. We also discussed hoe todevelop the neural network by training them.

We also discussed about thesimulation and results, how the performance changes with variation in differentparameters. Further, error correctio In the future are Neural networks do nottake much additional computational time or power, all they require is trainingprior to deployment. Neural networks are able to reduce the error significantlyas they are non-linear. They are able to compute the output quickly as they computethe output parallelly.