A Novel Wireless Sensor Node Positioning Algorithm Based on Ant Colony Optimization Algorithm and Neural Network

<span style="font-family: 'Times New Roman',serif; font-size: 10pt; mso-fareast-font-family: 'Times New Roman'; mso-fareast-language: DE; mso-ansi-language: EN-US; mso-bidi-language: AR-SA;">This paper aims to enhance the positioning accuracy of wireless sensor network (WSN) nodes. For this purpose, a WSN node positioning algorithm was proposed based on artificial bee colony (ABC) algorithm and the neural network (NN). First, the parameters between three anchor nodes and the target node were measured. Then, the ABC and NN were introduced to simulate and predict the ranging error, and the weight was determined according to the results. In the proposed algorithm, the cluster structure was effectively combined with the NN model. The weight of backpropagation NN was optimized by the ant colony optimization (ACO) algorithm. Then, the ACO-optimized NN was used to fuse the data collected by WSN nodes. The simulation results show that the proposed algorithm can improve the positioning accuracy of WSN nodes and reduce the time of the search. The research findings shed new light on the positioning of WSN nodes.</span>

type of algorithms. Thus, the range-based algorithms feature a high cost of node positioning, and a narrow scope of application [5~7]. Compared with range-based algorithms, the range-free algorithms are simple, accuracy and widely used [8]. This type of algorithms estimate internodal distance against the intensity of the transmitted signal and then calculate the target node position by trilateration.
In node positioning, the intensity of the received signal is usually determined by range-based algorithms. It is inevitable that the signal intensity would be disturbed by noises like airflow and multipath. In this case, there might be a certain time variation in the intensity of the received signal, which may cause a huge positioning error of sensor nodes [9]. To solve the problem, some experts have improved the conventional received signal intensity positioning algorithm, aiming to eliminate the external noises and enhance the positioning accuracy [10].
In WSN applications, the field data are collected constantly by sensors. The collected data share two common features: the data acquired by the same node remain basically the same within a certain period of time; the data acquired by neighbouring nodes are similar within a short period of time. Thus, the collected data are obviously redundant [11]. To eliminant redundancy, the data fusion technique should be introduced to the WSN to process and retransmit the original data as necessary. This is a good way to reduce the transmission load, lower energy consumption of nodes and prolong the service life of the WSN [12].

Neural network (NN)
Inspired by the nervous system in human brain, the NN is a self-adaptive and selforganized model containing numerous interconnected units called neurons. The model is known for its strong self-learning, distributed storage and data processing abilities. Over the years, the NN has been widely adopted to tackle fuzzy information problems that simultaneously involve many factors. The previous studies have shown that the NN is an ideal tool to deal with data fusion in the WSN [13].
Recent years has seen the integration between the NN and ant colony optimization (ACO) algorithm. For instance, Reference [14] introduces the ACO algorithm into the NN, forming an ACO-NN blind equalization algorithm. Reference [15] developed an improved power-efficient gathering in sensor information system (PEGASIS) based on the NN and the ACO algorithm.

Thesis statement
In this paper, a WSN node positioning method is proposed based on the NN and the artificial bee colony (ABC) algorithm, and then tested through experiments. The purpose is to develop an ideal positioning strategy for WSN nodes.

Backpropagation NN (BPNN)
Let x(i) be the input data. Then, the hidden layer input and output of the BPNN can be expressed as: (1) (2) where "# are the weights of input and hidden layers; # is the corresponding threshold. Besides, the input and output of the output layer can be expressed as: Where & are the weights of the hidden and output layers; is the corresponding threshold.

ABC algorithm
The ABC algorithm is an optimization technique that simulates the foraging behaviour of honey bees. In the ABC model, the colony consists of three groups of bees: employed bees, onlookers and scouts. It is assumed that there is only one artificial employed bee for each food source. Employed bees go to their food source and come back to hive and dance on this area. The employed bee whose food source has been abandoned becomes a scout and starts to search for finding a new food source. Onlookers watch the dances of employed bees and choose food sources depending on dances.
Let be a collection of n food sources, and = [ 1 , 2 , ⋯ , ] , = 1,2, ⋯ , be the location of food source i, i.e. solution i. Then, the food source can be estimated by the following fitness function: (5) where 6 is the objective function value of solution i. Then, the location of the food source i can be generated randomly. (6) where rand (0,1) is a random number Next, the employed bee's neighbourhood search for food sources can be expressed as: (7) where 6& are the locations of food sources around 6& ; and 6& is a random number within (-1, 1).
If a better food source is discovered, the location of the old food source will be replaced with the location of the new one. Otherwise, the location of the old food source will be retained. After the search by all employed bees, the information on food source will be transmitted to the onlookers.
According to fitness values, the onlooker chooses an employed bee to follow at the probability of 6 : Then, each onlooker searches the neighbourhood for food source and choose better food sources for preservation.
If the food source is not updated after a cycle, the location will be abandoned, and the employed bee will be transformed into a scout and look for a food source according to equation (6).

Trilateration algorithm
In geometry, trilateration is the process of determining the position of a node by its distances from three anchor nodes, using the geometry circles, spheres or triangles. The basic idea of trilateration algorithm is as follows: in 2D geometry, it is known that if a node lies on two circles, then the circle centres, i.e. the anchor nodes, and the two radii provide sufficient information to narrow the possible locations down to two. An additional circle that passes through the node may narrow the possibilities down to one unique location [17]. The principle of trilateration algorithm is shown in Figure 1 below.

Fig. 1. Principle of trilateration algorithm
As shown in Figure 1, node D is the point to be positioned. Let us denote its coordinates as ( , ). Meanwhile, the positions of the three anchor nodes A, B and C are (xA, yA), (xB, yB) and (xC, yC), respectively, and their distances to node D are dA, dB and dC, respectively. Then, the following relationships can be established:

Principle of WSN node positioning through ABC optimized-NN
Let n be the dissipation coefficient of path propagation. Under normal conditions, the received signal strength indicator (RSSI) can be calculated as: (10) where A is the ideal value of the RSSI. Equation (10) can be modified as: (11) In actual practice, the values of A and n are variable depending on the environment, and often determined empirically by experts. The subjective determination may cause ï î a huge error to node positioning. To overcome the problem, the values of A and n here are estimated in real time. The estimation process is as follows. The received signal strength indices between anchor node C and anchor nodes A and B can be obtained as: (12) Both = and > are Euclidean distances, which can be expressed as: (13) The values of A and n can be estimated according to equation (13), offering an accurate depiction of the environment state of the nodes.
To sum up, the WSN node positioning through ABC optimized-NN is implemented in four steps: first, the values of A and n are estimated; second, the NN is introduced to correct the estimated distances; third, the connection weights and thresholds of the NN are optimized by the ABC algorithm to obtain the distance weights; fourth, the location of the target node is calculated by the trilateration algorithm.

Error correction
The previous studies have shown that the RSSI estimation error increases with the distance of signal transmission. Hence, proper adjustment of distance is needed before estimating the values of A and n, that is, the values should be weighted to reduce the distance error. Weight describes the impact of an anchor node on the target node, while distance reflects the relative position between these two kinds of nodes. Here, weight ω " is defined as (14) Where 6 is a sequence of measured distances between anchor nodes and the target node. The position of the target node can be expressed as: (15) In actual practice, there is always a range error of ∆E. The relationship between actual distance ( ) and measured distance ( B ) is: Here, the NN is introduced to predict and correct the ranging error, and then the ABC algorithm is employed to optimize the NN parameters; the distance error was estimated by equation (11) and the prediction error is denoted as △E'. Thus, we have the positioning error correction equation: (17) During the NN-prediction of positioning error, the error of measured distance was determined by connection weights and thresholds. These weight and thresholds were optimized by the ABC algorithm. The NN predicts the distance error in the following steps: Step 1 Collect and normalize the sequence of measured distances: Step 2 Initialize the parameters, including the number of food sources, the number of iterations, the limit of the control parameter, and the restricted interval of the solution.
Step 3 Initialize the locations of the food sources: = [ 1 , 2 , ⋯ , ] , = 1,2, ⋯ , , with being the number of food sources, and D being the dimension. The dimension can be determined as: where M, H and N are the number of nodes in the input layer, hidden layer and output layer, respectively.
Step 4 Assign the weights and thresholds of the NN according to the 6 position. Then, the objective function value of 6 can be obtained through learning the training samples: (20) Where 6 and D are actual outputs and expected outputs, respectively; k is the number of training samples.
Step 5 Calculate the fitness value of the new solution 6 around 6 generated by the employed bees. According to the greedy criterion, preserve the one with better fitness between the new and old solutions.
Step 6 Select the solution by the probability of 6 . For any new solution 6 generated around 6 , retrain the optimal solution in the same way.
Step 7 Abandon the solution if it is not improved after a cycle. In this case, the employed bee will be transformed into a scout and look for a new solution.
Step 8 Find the best solution according to fitness value.
Step 9 After reaching the termination condition, obtain the optimal weights and thresholds of the NN according to the optimal solution; otherwise, return to Step 5. Step 10 Relearn the training samples according to the optimal weights and thresholds and establish the ranging error prediction model.
Step 11 Correct the ranging error based on the result of error prediction.

Two-level data fusion
In this research, the data collected by each WSN sensor are subjected to the data fusion by a two-level data fusion algorithm. Figure 2 illustrates the structure of the twolevel data fusion algorithm. As its name suggests, this algorithm adopts a two-level NN model. The first level targets the cluster member nodes, while the second level targets the cluster head nodes. Since each WSN has two data acquisition sensors, the cluster member nodes in the first level pre-processes the original data collected by each sensor in real time using the neural function of the first hidden layer, and treats the pre-processed results by the neural function of the second hidden layer and the output layer of the NN. In this way, a set of eigenvalues will be outputted to reflect the features of the data collected by WSN nodes. The second level data fusion mainly occurs in cluster head nodes, taking the eigenvalues outputted from the first level as the inputs. The results of the second level will be transferred to the sink node.

Introduction of ACO algorithm
Based on the previous research results, the ACO algorithm was introduced to the NN. To prevent the trap of local optimum, the heuristic factor was adjusted and search hotspot was set before the ants select the next search path. These moves ensure that the ants will choose the shortest path, thus improving the efficiency of ant colony search.
(1) Adjusting the heuristic factor In traditional ACO algorithm, 1 d "# ⁄ is generally used as the heuristic factor, with d "# being the distance between city i and city j. This factor ensures that the ants will choose the shortest path during the selection of the next search path. However, the distance relationship η "# (t) = 1 d "# ⁄ between city i and city j only reflects the relative location between the two city nodes, failing to describe the relationship between each node and the starting node. To solve the defect, the heuristic factor can be adjusted as: where d "# is the distance between the starting node and the current node. The value of d "# is negatively correlated with the probability for the ants to choose the shortest path. The adjustment considers both the inter-nodal distance and the distance between each node and the starting node, and guides the search towards the global optimal solution.
(2) Setting search hotspots The shortest path is most likely to fall within the circular search area whose diameter is the distance between the starting node and the target node. Therefore, this area is defined as the area of search hotspots, or the hotspot area. After determining whether the current path is in the hotspot area, it is possible to determine the probability formula for selecting the next path is determined according to whether hotspots are searched. Suppose there are ( = 1,2, ⋯ , ) ants. Then, the probability for each ant to choose an element in each set of M6 (1 ≤ ≤ ) can be expressed as: where 6& is the pheromone between i and j; ( ) is the set of cities that the ants have not visited at the moment; 6& ( ) has different values depending on whether path between i and j falls in the hotspot area: The introduction of hotspot area helps prevent the local optimum trap and enhance the search efficiency of the ACO algorithm.

Simulation Experiments
It is assumed that 100 common nodes and 20 anchor nodes are randomly distributed in a 2D area (100m×100m). Then, simulation experiments were carried out on Matlab using the proposed algorithm. Let d be the inter-nodal distance. Then, the energy to receive and transmit 1 bit of data can be expressed as: where S is the distance threshold for data transmission. Next, the node positioning error, an evaluation criterion, can be defined as:  To disclose effect of real-time updates of A and n on the positioning of sensor nodes, the results were compared with those of the fixed parameter value method and the ranging error was determined ( Figure 3). As shown in Figure 3, the positioning error after the dynamic updates was smaller than that of the fixed parameter value method,  To verify the effect of ABC-optimized NN, the positioning results of the method were contrasted with those of the positioning method without error correction. According to the results in Figure 4, it is clear that the positioning error of sensor nodes and its range were significantly reduced after the correction by ABC-optimized NN. This means the error correction can prevent the interferences in node positioning, yielding credible positioning results.
Next, the proposed algorithm was compared with the trilateration algorithm in terms of runtime, mean positioning error and maximum positioning error. The results are listed in Table 1 below. As shown in Table 1, the trilateration algorithm had a greater mean positioning error, which is mainly caused by the neglection of the external influences. Overall, the proposed algorithm boasts an obviously better positioning effect than trilateration algorithm, as evidenced by the low mean and maximum positioning errors and the short runtime. The good performance is attributable to the real-time updates of the values of A and n and the correction of positioning error by the NN.

Conclusions
In order to improve the positioning accuracy of WSN nodes, this paper puts forward a positioning algorithm of sensor nodes based on ABC-optimized NN.