Monte Carlo localization method
Monte Carlo localization method was originally applied to the field of robot localization, and the distinction between the robot localization and the sensor node’s positioning in mobile wireless sensor network is very remarkable [18]. In the process of robot walking, the robot’s CPU is equipped with a map, and the path guidance will be abided to the prescribed route in the map. However, all sensor nodes will move in a random mode in the designated area. The location method based on Monte Carlo is actually a continuous iterative Bayesian filter, and the basic idea is to make use of some weighted samples to represent the posterior probability density distribution of the estimated state, so as to obtain the solution of the node position. This method can be applied to non-Gauss, nonlinear and multidimensional system, which is beneficial for the characteristics including flexibility, easy to implement, and suitable for parallel processing. Those merits make it very suitable for node localization in wireless sensor networks.
Since that the neighbor nodes within the range of transmission radius can communicate with each other, the known information from anchor nodes can be used to assist blind node’s localization [19]. The Monte Carlo localization method is based on the Bayes filtering theory, and the main idea is by utilizing the new observation from the adjacent anchor nodes within the range, the sample and filter steps will be repeated until enough valid samples can be obtained. Then, the blind node can estimate its current location as it completes the movement [20]. Therefore, the resolution of the blind node’s localization can be transferred into the posterior probability density function. Let t be a discrete time series, x
t
is the state of hidden Markov processes with initial distribution P(x0), x
t
∈Rn
x
where n
x
is the dimension of state vector. Transfering equation P(x
t
|xt-1) demonstrates the dynamic features of the state space model. Meanwhile, the observation sequences {o1, o2, o3, …, o
t
} are independent of each other at a given node’s position {x1, x2, x3 …, x
t
}, where O
t
∈ Rn
0
and n0 is the dimension of the observation vector. P(o
t
|x
t
) is the observation equations, and it denotes the probability of observed values under the condition of a given position x
t
.
Suppose that the location of mobile nodes satisfies Markov assumptions in mobile wireless sensor networks, and the observation and node’s position are independent. This indicates that the observations only depend on the current position, and the current position x
t
lies on the position xt-1 at the previous time interval. Thus, the resolution of the location of blind nodes can be converted into a posteriori probability density function p(x
t
|o0t).
The posterior probability density function at time t can be approximated by some weighted samples\( \left({x}_t^i,{w}_t^i\right) \), and we have:
$$ p\left({x}_t|{o}_{0:t}\right)=\sum \limits_{i=1}^N{w_t^i}^{\ast}\delta \left({x}_t-{x}_t^i\right) $$
(1)
where δ is the Dirac-delta function, and N represents the number of samples for the node’s location. \( {x}_t^i \) is a possible sample of node at time t, and \( {w}_t^i \) is a nonnegative weight.
The sample weight will be updated as the following formula:
$$ {w}_t^i=\frac{p\left({o}_t|{x}_t^i\right)p\left({o}_t|{x}_{t-1}^i\right)}{\phi \left({x}_t^i,{x}_{0:i-1}^i,{o}_{0:t}\right)}{w}_{t-1}^i $$
(2)
where ϕ is the adjustment function being relevant to \( {x}_t^i,{x}_{0:i-1}^i,{o}_{0:t} \).
Since the sensor nodes move randomly in a certain area, and the size and direction of motion are unknown. The maximum speed of motion is limited to v0; the current position of the node must be in the circle area with the center point of the position at the previous moment and a radius of maximum moving speed v0. Then, the sample probability distribution at the present moment can be expressed as:
$$ p\left({z}_t|{z}_{t-1}\right)=\left\{\begin{array}{l}0,d\left({z}_t,{z}_{t-1}\right)\ge {v}_0\\ {}\frac{1}{\sqrt{\pi {v}_0^2}},d\left({z}_t,{z}_{t-1}\right)<{v}_0\end{array}\right. $$
(3)
where d(z
t
,zt-1) denotes the Euclidean distance between the sample at current and previous time.
Objective function optimization based on sample weight
The anchor nodes will broadcast the ID identification and location information periodically. Suppose that the broadcast message from the set of anchor nodes within one-hop S(s) and the two-hop T(s) can be received by the blind node at the current time, the samples that does not satisfy the condition can be rejected in the process of filtering prediction with reference to the observation requirement. The eligible samples must be within the communication radius of a neighbor anchor node; meanwhile, the distance between the sample and the two-hop anchor node must be less than two times of the communication radius. Thus, the constraints can be expressed as: ∀s∈S(s), d(z,s) ≤ r∩∀s∈T(s), r < d(z,s) ≤ 2r.
According to the N samples of the position and the value of \( \left({z}_t^i,{w}_t^i\right) \), the current position of the blind node can be estimated as:
$$ {CurPOS}_t=\sum \limits_{i=1}^N{z}_t^i\cdot {w}_t^i $$
(4)
The sample weights, i.e., the proportion of the samples in the final positioning result, are a measure of the merits of the standard sample. The observation results O
t
of ordinary nodes are composed of a one-hop neighbor anchor node set S, two-hop anchor node set T and the set of normal nodes within the transmission range TR, and O
t
= S∪T∪TR. Considering the size of the sample constraint box, the confidence function is introduced into the localization results to reflect the confidence degree of node i at time t, of which the value depends on the size of the constraints from sampling box.
$$ {w}_t^i=p\left({O}_t|{z}_t^i\right)=\left(\prod \limits_{s\in S\cup T}p\left(s|{z}_t^i\right)\right)\cdot \left\{\sum \limits_{s\in TR}\right(\gamma \left(s,t-1\right),d\left({z}_t^i,s\right)<r\Big\} $$
(5)
where \( \gamma \left(i,t\right)=\gamma /{\gamma}_i^t \) and \( {\gamma}_i^t \) is the diagonal length of the sampling box of node i at time t, and γ is the diagonal length of the entire region.
if s ∈ S,
$$ p\left(s|{z}_t^i\right)=\left\{\begin{array}{l}1,0<d\left(s,{z}_t^i\right)<r\\ {}0, else\end{array}\right. $$
(6)
if s ∈ T,
$$ p\left(s|{z}_t^i\right)=\left\{\begin{array}{l}1,r<d\left(s,{z}_t^i\right)<2r\\ {}0, else\end{array}\right. $$
(7)
where the sample weight is regarded as the objective function of the optimization.
The process of sampling optimization
Owing to the similarity of the idea between the differential evolution algorithm and the Monte Carlo algorithm, the individual vector in differential evolution algorithm can be regarded as a particle sample. Moreover, if the population number is equal to the size of the particle set, then the population in the differential evolution algorithm is equivalent to the particle set in the Monte Carlo localization algorithm. Hence, it is convenient to involve differential evolution method into Monte Carlo localization algorithm. In the sampling phase, the sample weight is taken as the objective function, and the differential evolution algorithm is implemented. Then, the actual position of sample can be approached to the node to be positioned actively rather than to be filtered, and the final estimate of node’s position can be obtained. The detailed steps are as follows:
-
1.
Initialization: According to the initial variable interval [zmin,zmax] of the variable given by the specific problem, the linear transformation can be given as:
$$ {z}_{ij}(0)={z}_{\mathrm{min}}+\mathit{\operatorname{rand}}\left(0,1\right)\cdot \left({z}_{\mathrm{max}}-{z}_{\mathrm{min}}\right) $$
(8)
where z
ij
(0) denotes the j-th variable of individual i; rand(0,1) represents the random number with the range of [0,1].
-
2.
Mutation: The different individuals Zr1(g), Zr2(g), and Zr3(g) are selected, and the perturbation vectors are generated according to the following method:
$$ {v}_i\left(g+1\right)={z}_{r1}(g)+\eta \left({z}_{r2}(g)-{z}_{r3}(g)\right) $$
(9)
where η is the control factor to adjust the amplitude of the individual difference, and Z
i
(g) denotes the i-th individual in population g.
During the process of evolution, it is necessary to determine whether the variables satisfy the boundary conditions to ensure the validity of the solution. Otherwise, the variable will be generated randomly repeatedly.
-
3.
Cross operation: The crossover between individuals {Z
i
(g)} of the g-th generation and its mutant intermediates {v
i
(g + 1)} can be given as:
$$ {u}_{ij}\left(g+1\right)=\left\{\begin{array}{l}{v}_{ij}\left(g+1\right),\kern0.3em \mathit{\operatorname{rand}}\left(0,1\right)\kern0.3em \le \rho \kern0.2em \\ {}{z}_{ij}(g)\end{array}\right. $$
(10)
where ρ is the crossover probability.
-
4.
Select operation: Greedy algorithm is applied to select the individuals with high fitness to enter the next generation:
$$ {z}_i\left(g+1\right)=\left\{\begin{array}{l}{u}_i\left(g+1\right),\kern0.3em f\left({u}_i\left(g+1\right)\right)\le f\left({z}_i(g)\right)\\ {}{z}_i(g),\kern0.7em else\end{array}\right. $$
(11)
Self-adaption of scaling factor and cross probability
Since the selection of η and ρ is the key to the behavior and performance of differential evolution and affects the convergence of the algorithm directly, η and ρ should be varied with fitness and evolutionary algebra dynamically.
When the fitness of individuals in the population tends to converge or converges to the local optimal solution, the value of η will increase. Otherwise, η decreases as the fitness of population is being dispersed. At the same time, for the individuals whose fitness is greater than the average, the corresponding value of η is large and the solution should be given up. On the contrary, the individual’s fitness is lower than the average value, of which is close to the average degree. Therefore, the adaptive zoom factor can provide the optimal solution with respect to the value ofη. The adaptive differential evolution algorithm should maintain the diversity of population as well as to ensure the convergence of difference. Based on the above analysis, η can be adjusted adaptively according to the following formula:
$$ \eta =\left\{\begin{array}{l}\ln \frac{f_{avg}-{f}^{\prime }}{f_{avg}-{f}_{best}},\kern0.4em {f}^{\prime }<{f}_{avg}\\ {}1,\kern0.6em {f}^{\prime}\ge {f}_{avg}\end{array}\right. $$
(12)
where f indicates the fitness value of individuals to be mutated, f
avg
is the average fitness value of the population, and f
best
is the maximum fitness value in the population. At the beginning of the algorithm, the difference between f
avg
and f
best
are very large, and there is almost no possibility of local convergence. With the progress of the generation evolution, the gap between f
avg
and f
best
will decrease. Meanwhile, f merges a decrease trend and the speed for converging to the optimum solution will continue to be accelerated gradually, which reduce the risk of falling into local convergence.
The probability of crossover demonstrates the possibility that the genes for mutating individuals can be selected to a new individual. Hence, the adaptive function is presented to adjust the value of ρ dynamically according to the senior generation individual. Initially, ρ is set as a relatively small value ρ0, which ensures the population diversity with a low probability of crossover. With the evolution of the individual, the individuals begin to converge gradually. At this time, the increase of ρ value will not only improve the variation of gene selection’s probability but also speed up the convergence rate. When the ρ = ρ*, the value of ρ will increase no longer and remain stable. The value of ρ can be given as:
$$ \rho =\left\{\begin{array}{l}\frac{G}{\ln \left(100-G\right)}+{\rho}_0,\kern0.4em \rho <{\rho}^{\ast}\\ {}{\rho}^{\ast },\kern0.4em \rho \ge {\rho}^{\ast}\end{array}\right. $$
(13)
where G indicates the generation.
The value of sample weights is equal to 0 or 1, and value 1 denotes that the corresponding sample can satisfy with the filtering condition. When the number of sample weights reaches to N or the maximum generation G, the evolutionary algorithm terminates. Finally, the estimation of node’s localization can be obtained by using the sampled nodes being selected optimally from the differential evolution algorithm.
Obtain the positioning results
Before employing the final N samples to calculate the localization results, the weights of the samples should be normalized as:
$$ {\tilde{w}}_t^i={w}_t^i/\sum \limits_{i=1}^N{w}_t^i $$
(14)
Then, the estimation of the coordinate of the node i at time t can be obtained by the N samples:
$$ \left\{\begin{array}{l}{x}_i^t=\sum \limits_{j=1}^N{w}_t^j\cdot {x}_t^j\\ {}{y}_i^t=\sum \limits_{j=1}^N{w}_t^j\cdot {y}_t^j\end{array}\right. $$
(15)
Considering that the actual position of the nodes be included in the constraint sampling box, the range of (xmin,xmax; ymin,ymax) denotes that all the samples are obtained in the sample box. The sample within the range must satisfy the constraints of the weighted average. Therefore, the actual node’s localization error must be less than the maximum difference between the estimation of node’s position and the boundary coordinates of sampling box. We have:
$$ \left\{\begin{array}{l}{err}_{x,\max}^t=\max \left({\tilde{x}}_t-{x}_{\mathrm{min}},{x}_{\mathrm{max}}-{\tilde{x}}_t\right)\\ {}{err}_{y,\max}^t=\max \left({\tilde{y}}_t-{y}_{\mathrm{min}},{y}_{\mathrm{max}}-{\tilde{y}}_t\right)\end{array}\right. $$
(16)