Abstract
Accurate localization of nodes is one of the key issues of wireless sensor network (WSN). Because the disadvantages of the classical Amorphous algorithm will produce large localization error in the process of localization, an improved localization algorithm is proposed in this paper to solve the problem. The improved algorithm introduces the received signal strength threshold to modify the minimum hop from the unknown node to the beacon node. Then, Back Propagation (BP) algorithm is introduced to optimize the threshold and reduce the localization error. The simulation results show that the localization accuracy of the improved algorithm is higher than that of other algorithms and the energy consumption does not increase too much.
1. Introduction
Wireless sensor network (WSN) is composed of a large number of sensor nodes, which can monitor and acquire physical information in the distribution detection area in real time. WSN has gained a wide attention in recent years and has been applied to the medical field, the industry, the military, and other fields, such as remote health, smart home, battlefield reconnaissance, and environmental monitoring. The location of sensor nodes needs not be engineered or predetermined. This means that sensor nodes can be deployed randomly in inaccessible terrains or disaster relief operations. In addition, this also means that sensor network protocols and algorithms must possess self-organizing capabilities [1].
The localization problem of WSNs can be interpreted that, in a sensor network in which the own location of multiple nodes has been known, which is named by the beacon node, and the location of target node which is named by the unknown nodes is obtained by the sensor information and effective localization algorithm. According to most of the applications in WSN, the information without space and time data is unvalued. In order to better monitor and track the target, the location of sensor node is one of the most important information [2, 3]. In recent years, localization of wireless sensor network node has become a popular and significant issue.
At present, according to whether or not the network needs to measure the actual distances between network nodes, the WSN localization algorithm can be divided into two categories: one is Range-Based algorithm and the other is Range-Free algorithm. The Range-Based algorithm mainly includes the measurements of angle and distance, such as Received Signal Strength Indicator (RSSI), Time of Arrival (TOA), Time Difference on Arrival (TDOA), and Angle of Arrival (AOA) [3]. Then, the location of the unknown node can be calculated by the trilateral measurement method and triangulation method. So it needs extra hardware supporting, large computing, and communicating with high energy consumption. The Range-Free approach only depends on the connectivity of nodes such as the hops for localization without any extra hardware supporting. It includes Centroid algorithm [4], Distance Vector-Hop (DV-Hop) [5], and Amorphous algorithm. Although the localization accuracy of the range-based algorithm is usually higher than that of the range-free algorithm, because of the simple hardware support, the lower consumption, and the antinoise ability, the range-free algorithm is widely used in many applications.
In this case, how to improve the localization accuracy of Range-Free approach has drawn much attention. Many experts put forward the optimization algorithms based on intelligent algorithm to improve the localization accuracy. For example, BP localization algorithm based on virtual nodes (VN-BP) with lower localization error has been proposed in [6]. The advantages of BP artificial neural network in error optimization are formidable self-organizing and self-learning capacity, error back-propagation, and error minimum principle [7]. Therefore, it is a good idea to introduce BP neural networks in the localization algorithm to improve the localization accuracy. Although Amorphous algorithm is easy to implement, it will produce large error in the process of localization. In order to solve the problem, an improved localization algorithm is proposed in this paper to reduce the localization error. The proposed algorithm is clarified in two aspects: (1) modify the minimum hop from the unknown node to the beacon node by setting the received signal strength threshold; (2) BP algorithm is introduced to optimize the threshold and reduce the localization error.
2. Amorphous Localization Algorithm
Amorphous algorithm is similar to DV-Hop algorithm, and the idea is to calculate the hop distance between two nodes instead of the linear distance between them. Amorphous algorithm is composed of the following three steps [8].
2.1. Calculate the Minimum Hop from the Unknown Node to the Beacon Node
Every beacon node sends messages to the unknown nodes by flooding method. Formula (1) is used to calculate the minimum hop from the node i to k:
2.2. Calculate the Distance from the Unknown Node to the Beacon Node
Formula (2) is used to calculate the average distance of one hop:
The distance d from the unknown node to the beacon node can be calculated on the basis of the average distance of one hop and the minimum hop from the unknown node to the beacon node. It can be expressed by the following formula:
2.3. Adopt the Least Squares Method to Locate
When the estimated distances from the unknown node to three or more than three beacon nodes have been obtained, the location of the unknown node can be calculated. It is shown as
3. The Improved Amorphous Algorithm Based on BP Artificial Neural Network
Because the disadvantages of the classical Amorphous algorithm will produce large localization error in the process of localization, an improved localization algorithm is proposed in this paper to solve the problem. The improved algorithm introduces the received signal strength threshold to modify the minimum hop from the unknown node to the beacon node. Then, BP algorithm is introduced to optimize the threshold and reduce the localization error. The improved algorithm is composed of the following two parts. Sections 3.1 and 3.2 describe the two parts, respectively.
The flow chart of the improved algorithm is shown in Figure 1.

The flow chart of the improved algorithm.
3.1. The Choice of the Hop
In the classical Amorphous localization algorithm, there exists large deviation when calculating the distance d. As shown in Figure 2, nodes A and B are both in the wireless range of node O. As a result, the hops of them are set as one, while the disparity of

Principle diagram of hops correction.
Therefore,
3.2. BP Algorithm Will Be Introduced to Optimize the Threshold to Reduce the Localization Error
The received signal strength threshold has been set to modify the minimum hop. How many the threshold should be set to minimize the localization error? In order to solve the problem, the BP neural network is introduced to optimize the threshold and reduce the localization error.
BP neural network is one of the most widely used models in neural networks. BP algorithm is a neural network of three-tier or more structure. This method with the Error Minimum Principle and using recursive method to find the network weight and threshold of each node among BP algorithms is called deepest gradient descent. The advantages of BP artificial neural network in error optimization are formidable self-organizing and self-learning capacity, error back-propagation, and error minimum principle [7, 10]. A three-layer BP neural network is constructed in this paper (see Figure 3) and operated on the sensor nodes. Steps of the proposed algorithm are as follows.

Neural network model.
Step 1.
Firstly, the BP neural network is operated on the sensor nodes and trained by the data of beacon nodes.
Step 2.
The received signal strength threshold M and the signal strength
Step 3.
Calculate the input and output of each unit in the network.
The input
The output
The output
Step 4.
Calculate the error δ output unit k:
Step 5.
Update each weight w output unit k:
Thus,
Step 6.
This training process is carried out continuously until the network error is reduced to an acceptable level or preset numbers of learning. Then, the location of the unknown node can be calculated on the basis of (5) and (6) in Section 2.
4. Simulation and Analysis
4.1. The Simulation Platform and Distribution of Nodes
MATLAB simulation software can be used to verify the feasibility of the proposed algorithm. Network deployment area is 1000 m × 1000 m, the node coordinates are generated randomly, the number is 300, there are 60 beacon nodes, the proportion of beacons is 20%, the wireless range is 300 m, and communication model is Regular Model. Distribution of nodes is shown in Figure 4.

Distribution of nodes (the red star points represent the anchor nodes and the little blue circles represent the unknown nodes).
4.2. The Definition of Localization Error
The localization error is an extremely important indicator to evaluate the localization performance. Formula (16) is used to calculate the localization error:
4.3. The Simulations of Amorphous Algorithm, VN-BP Algorithm, and Improved Algorithm
First of all, Amorphous algorithm, VN-BP algorithm, and improved algorithm can be simulated to get the localization error figure. It is shown in Figure 5.

The localization error figures: (a) Amorphous algorithm, (b) VN-BP algorithm, and (c) Improved algorithm.
In Figure 5, the little blue circle represents the estimated location of the unknown node and the blue line represents the localization error of the unknown node. The localization error of Amorphous algorithm is 0.23107. BP Localization Algorithm Based on Virtual Nodes (VN-BP) is proposed in [6]. In Figure 5(b), the localization error is 0.14818, the localization accuracy of VN-BP algorithm is higher than that of the original Amorphous algorithm. In Figure 5(c), the localization error of improved algorithm is 0.11958. We can see that the localization accuracy of the improved algorithm is higher than that of the original Amorphous algorithm and VN-BP algorithm obviously from the figure.
4.4. The Simulations of Amorphous, VN-BP, and Improved Algorithm in Different Proportions of Beacons
The localization error figures of Amorphous algorithm, VN-BP algorithm, and improved algorithm in different proportions of beacons are shown in Figure 6. It is clear that the localization accuracy of the improved algorithm is superior to that of the original Amorphous algorithm and VN-BP algorithm; it improves the localization accuracy effectively. And the localization error of improved algorithm declines as the proportion of beacons increases.

The localization error in different proportions of beacons: (a) Amorphous, (b) VN-BP, and (c) Improved algorithm.
4.5. The Simulations under Different Conditions Are Completed for the Five Algorithms
To find out the performance of the algorithm proposed in this paper, the simulations under different conditions are completed for Centroid, DV-HOP, Amorphous, VN-BP (which selects the unknown nodes as the subbeacons based on the virtual nodes), and the improved algorithm. All the nodes in the simulation are randomly distributed in the area 1000 m × 1000 m. Each set of the condition is run for 1000 times so as to factually reflect the localization error of different algorithms. The average value of the localization error is used for the comparison [6].
In the condition of different proportions of beacons, there are 300 nodes in total with wireless range being set as 300 m. From Figure 7(a), it is clear that the localization error of the five algorithms decreases as the proportion of beacons increases. Under the same proportion of beacons, the localization error of the improved algorithm decreases, respectively, about 25%, 20%, and 12% on average than that of the Centroid algorithm, DV-HOP algorithm, and Amorphous algorithm. The localization accuracy of the improved algorithm is higher than that of the VN-BP algorithm, and the localization error is reduced by about 3% on average, demonstrating the effectiveness of the improved algorithm in different proportions of beacons.

The localization error under different conditions: (a) proportion of beacons and localization error, (b) wireless range and localization error, and (c) number of nodes and localization error.
In the simulation of different wireless range, the proportion of beacons is set by 20% and the total number of nodes is set by 300. Figure 7(b) shows the result of the simulation. It is clear that the localization error of the improved algorithm and VN-BP algorithm decreases as the wireless range increases. In the same condition, the localization error of the improved algorithm decreases, respectively, about 17% and 18% on average than that of the Centroid algorithm and DV-HOP algorithm. The localization error of the Amorphous algorithm increases when wireless range is more than 300 m. And the improved algorithm overcomes the problem. The localization accuracy of the improved algorithm is higher than that of the VN-BP algorithm, and the localization error is reduced by about 3% on average, reflecting the effectiveness of the improved algorithm in different wireless range.
Based on different numbers of nodes, wireless range is set as 300 m, and the proportion of beacons is set as 20%. The result is shown in Figure 7(c). It is clear that the localization error of the 5 algorithms decreases as the number of nodes increases. In the same number of nodes, the localization error of the improved algorithm decreases, respectively, about 23%, 22%, and 15% on average than that of the Centroid algorithm, DV-HOP algorithm, and Amorphous algorithm. The localization accuracy of the improved algorithm is higher than that of the VN-BP algorithm, and the localization error is reduced by about 3.5% on average, showing the effectiveness of the improved algorithm in different numbers of nodes.
4.6. The Computing Time of Improved Algorithm Is Compared with Other Algorithms
According to the analysis of the paper [12], computational costs make up only a small part of all energy consumption in WSN; most of the energy consumption is communication. So decreasing the energy consumption of communication is the key to extend the lifecycle of network. In order to decrease the energy consumption of communication, all nodes cannot send the information to a central node to calculate their location, because the energy consumption of communication is too large. The improved localization algorithm should adopt distributed computation, and the neural network is constructed and operated on the sensor nodes. Table 1 compares the average computing time needed by the five algorithms to localize a single node and localization error.
Average computing time to localize single node and localization error.
All experiments are conducted on the same computer. Network deployment area is 1000 m × 1000 m, the node coordinates are generated randomly, the number is 300, the proportion of beacons is 20%, the wireless range is 300 m, and communication model is Regular Model. Due to the simple calculation, Centroid algorithm generally requires less computing time than the other four algorithms. Amorphous algorithm is similar to DV-Hop algorithm. VN-BP algorithm and improved algorithm require more computing time because of the neural network model construction. In addition, VN-BP algorithm takes much time to find virtual nodes. The algorithms need more computing time as the localization error decreases. This is an unavoidable problem. But the improved algorithm decreases the energy consumption of communication and greatly improves localization accuracy; the total energy consumption increases a little bit. The results will be described in Section 4.7.
4.7. The Energy Consumption of Improved Algorithm Is Compared with Other Algorithms
To find out the performance of the algorithm proposed in this paper, the simulations of energy consumption under different conditions are completed for Centroid, DV-HOP, Amorphous, VN-BP, and the improved algorithm. All the nodes in the simulation are randomly distributed in the area 1000 m × 1000 m. Each set of the condition is run for 1000 times so as to factually reflect the energy consumption of different algorithms.
In the condition of different proportions of beacons, there are 300 nodes in total with wireless range being set as 300 m. The result of energy consumption is shown in Figure 8(a). It is clear that energy consumption of the five algorithms increases as the proportion of the beacons increases. Under the same proportion of beacons, the energy consumption of Centroid algorithm is lowest, because it broadcasts only once. DV-hop algorithm needs to broadcast twice, so the energy consumption of communication is large [13]. The energy consumption of improved algorithm and that of classical Amorphous algorithm are almost the same. They all adopt distributed computation, so the energy consumption of communication is decreased. But the improved algorithm takes some time to construct the neural network; energy consumption increases a little bit. A little increase of energy consumption can be ignored considering that the improved algorithm greatly improves localization accuracy. Moreover, the energy consumption of improved algorithm is lower than that of VN-BP algorithm. This reflects the effectiveness of the improved algorithm in energy consumption.

Energy consumption under different conditions: (a) energy consumption on different proportions of beacons, (b) energy consumption on different wireless range, and (c) energy consumption on different numbers of nodes.
In the case of different wireless range, there are 300 nodes in total with proportion of beacons being set as 20%, and in the case of different numbers of nodes, wireless range is set as 300 m, the proportion of beacons is set as 20%. The similar result can be got in Figures 8(b) and 8(c). It is certain that accurate localization will bring more energy consumption. So localization algorithm should be designed according to different applications.
5. Conclusions
The localization accuracy is an extremely important indicator to evaluate the localization performance. The higher the localization accuracy is, the better the localization performance is. Because the disadvantages of the classical Amorphous algorithm will produce large localization error in the process of localization, an improved localization algorithm is proposed in this paper to solve the problem. The improved algorithm introduces the received signal strength threshold to modify the minimum hop from the unknown node to the beacon node. Then, BP algorithm is introduced to optimize the threshold and reduce the localization error. Simulation results show that the improved algorithm overcomes the error stack effect of traditional Amorphous algorithm in the case of multiple hops and greatly improves localization accuracy. In addition, the localization accuracy of improved algorithm is higher than that of other algorithms and the energy consumption does not increase too much. Therefore, it is suitable for the actual large-scale network node localization.
Footnotes
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgments
This work is supported by the National Natural Science Foundation of China (nos. 61472278, 60872064, and 61102125) and the Natural Science Foundation of Tianjin (no. 12JCYBJC10200).
