Next Article in Journal
Stochastic Latency Guarantee in Wireless Powered Virtualized Sensor Networks
Previous Article in Journal
Gesture Recognition Based on Multiscale Singular Value Entropy and Deep Belief Network
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:

iBeacon Indoor Positioning Method Combined with Real-Time Anomaly Rate to Determine Weight Matrix

Civil Engineering College, Nanjing Forestry University, Nanjing 210037, China
Author to whom correspondence should be addressed.
Sensors 2021, 21(1), 120;
Received: 27 November 2020 / Revised: 19 December 2020 / Accepted: 23 December 2020 / Published: 27 December 2020
(This article belongs to the Section Intelligent Sensors)


This paper proposes an indoor positioning method based on iBeacon technology that combines anomaly detection and a weighted Levenberg-Marquadt (LM) algorithm. The proposed solution uses the isolation forest algorithm for anomaly detection on the collected Received Signal Strength Indicator (RSSI) data from different iBeacon base stations, and calculates the anomaly rate of each signal source while eliminating abnormal signals. Then, a weight matrix is set by using each anomaly ratio and the RSSI value after eliminating the abnormal signal. Finally, the constructed weight matrix and the weighted LM algorithm are combined to solve the positioning coordinates. An Android smartphone was used to verify the positioning method proposed in this paper in an indoor scene. This experimental scenario revealed an average positioning error of 1.540 m and a root mean square error (RMSE) of 1.748 m. A large majority (85.71%) of the positioning point errors were less than 3 m. Furthermore, the RMSE of the method proposed in this paper was, respectively, 38.69%, 36.60%, and 29.52% lower than the RMSE of three other methods used for comparison. The experimental results show that the iBeacon-based indoor positioning method proposed in this paper can improve the precision of indoor positioning and has strong practicability.

1. Introduction

Nowadays, Global Navigation Satellite System (GNSS) technology, navigation, and positioning services have become an indispensable service in people’s lives, especially for travel-related services. Such location services cannot be provided indoors, however, due to difficulties in receiving signals from GNSS satellites [1]. How to achieve fast, cheap, stable, and high-precision positioning and navigation in indoor contexts where satellite signals are missing has therefore become an urgent problem to be solved. At present, positioning and navigation services for indoor uses mainly rely on technologies such as Wireless Local Area Network (WLAN), Ultra-Wide Band (UWB), iBeacon, etc. [2,3,4]. Of these, iBeacon has been favored by many scholars due to its low cost, ease of operation, and signal stability [5]. In addition, indoor positioning and navigation services based on this technology have already been commercialized in many large shopping malls, parking lots, and other such venues [6].
Target positioning based on iBeacon technology mainly depends on the RSSI (Received Signal Strength Indication) value of the iBeacon base station broadcast signal [7]. Specifically, the current methods for solving positioning coordinates based on iBeacon technology are mainly divided into two types: fingerprinting technology and trilateration model. A comparison of these two main techniques is shown in Table 1 [8,9,10,11].
Fingerprinting technology has become a hot topic in current research due to its high stability and precision. The basic theory of Fingerprinting technology is to match the RSSI with the values in the database. It is not necessary to convert the RSSI value through a multi-mathematic model into a distance for positioning calculation. Therefore, this method does not require a distance estimation model and is more stable. This approach, however, requires a complete and detailed fingerprint database to be collected and constructed in the locations where it is used, alongside the installation of base stations. This in turn raises costs and increases the complexity of the positioning process, meaning that the technology cannot be easily applied in any location [12]. In contrast, the only preliminary work needed in the trilateration approach is the deployment of iBeacon base stations at fixed locations and determination of the ranging model parameters, meaning that it is simple and economical to implement.
On the other hand, the trilateration method cannot deliver highly precise positioning, with an absolute positioning error of about five meters [3]. How to improve the positioning precision and stability of the trilateration method has therefore become a problem worthy of research. The relative imprecision of the trilateration method arises partly from its reliance on a nonlinear positioning model, which seeks the best the optimal solution algorithm, and partly from the fact that environmental influences make the RSSI value of the iBeacon base station signal unstable. In addition, the particular trilateration model used also affects the positioning precision. At present, the most commonly used method is to perform differential linearization and then apply the least squares method to solve, or iteratively solve, the positioning coordinates [13,14].
In the above approach, as the RSSI is prone to fluctuations, it is often necessary to do some preprocessing of the original signal before positioning. At present, the main methods used for the preprocessing of abnormal RSSI signal values are filtering algorithms, such as Kalman filtering, particle filtering, mean filtering, etc. [15,16,17]. While these methods can often achieve good results when there is a large amount of RSSI signal data available, in practice it is often necessary to perform coordinate calculations within just a few seconds, which requires a signal anomaly detection method that can be applied effectively even when the amount of data is small. At the same time, most of the current preprocessing methods for RSSI signals only reduce noise and eliminate abnormal signals, and thus do not make full use of the abnormal characteristics of the signal source.
This paper therefore proposes the use of the isolation forest algorithm [18] to detect and eliminate signal anomalies even with a small sample size. It then calculates the anomaly rate of each signal source while removing abnormal signals, and sets the weight matrix using each anomaly rate and the RSSI after removing abnormal signals. Finally, using the most common trilateration model solution method—i.e., the least squares method—a weighted Levenberg-Marquardt (LM) algorithm [19] is constructed to achieve high-precision positioning indoors, based on iBeacon technology.

2. Materials and Methods

2.1. Overview

The goal of this paper is to verify an indoor high-precision fast positioning method based on iBeacon technology. The basic theory of this paper is trilateration, applying the isolation forest algorithm and the weighted LM algorithm. The basic idea of this paper is to first collect the RSSI values of all iBeacon base stations deployed in the indoor scene, and then use the isolation forest algorithm to perform anomaly detection on the RSSI values of each signal source in a short period of time. After detecting abnormal signals, the anomaly rate of the signal broadcast by each iBeacon base station is calculated, and the average value of each group of signals, after removing the abnormal RSSI signal, is adopted as the final RSSI at the current point. Finally, a weight matrix is generated by combining the signal anomaly rate of each iBeacon base station with the RSSI value. Under the constraints of this weight matrix, the LM algorithm is used to solve the coordinates. The method flowchart of this paper is shown in Figure 1.

2.2. BLE-Based and Trilateration

The trilateration method (see Figure 2) for indoor positioning based on Bluetooth low-energy devices is a fast and cheap positioning method. It determines the current point coordinates mainly by receiving the RSSI value broadcast by iBeacon base stations deployed in a fixed position in an indoor scene and applying a 2D plane coordinate solution model such as in Equation (1) below [20],
{ ( x i x 1 ) 2 + ( y i y 1 ) 2 = D 1 2 ( x i x 2 ) 2 + ( y i y 2 ) 2 = D 2 2 ( x i x n ) 2 + ( y i y n ) 2 = D n 2
where ( x i , y i ) is the unknown coordinate of the current point, ( x n , y n ) is the fixed coordinate of each iBeacon base station, and D n is the distance between the current unknown point and each iBeacon base station. This distance can be calculated by an attenuation factor model between the RSSI value and D, as in Equation (2) [21]: Equation (1) only discusses the 2D situation, because the plane coordinates already satisfy most situations when used in daily life; however, Equation (1) can also be extended to 3D coordinates. At this time, we only need to add a Z coordinate (elevation coordinate) to the model. At this time, the basic formula in Equation (1) can be written as
( x i x n ) 2 + ( y i y n ) 2 + ( z i z n ) 2 = D n 2
P = P ( d 0 ) 10 n lg ( d d 0 )
where P is the RSSI value of the fixed iBeacon base station received at the current unknown point, P ( d 0 ) is the RSSI value from the iBeacon base station at a certain distance, generally d 0 = 1 m , and n is the signal attenuation factor in the current scene. In different environments, its value is also not always the same, and thus the relationship between the RSSI value and D (Distance between receiving signal point and base station) has to be obtained, as in Equation (3).
D = 10 P ( d 0 ) P 10 n
For the purposes of this paper, we set P ( d 0 ) to A n , and rewrite P to the collected RSSI value to get Equation (4). This means that there are then only two unknown parameters in the formula A n , n . These can be obtained by doing fixed distance experiments and fitting in the experimental data.
D = 10 A n RSSI 10 n
As for the solution of Equation (1), it is currently more common to linearize it first and then solve it by least squares, giving the final solution formula as Equation (5):
X = ( B T W B ) 1 B T W l
where X is the current unknown point coordinates. B , l can be obtained by linearizing the Equation (1), and the weight matrix W is usually set 1 RSSI 2 . When only the data broadcast by three iBeacons are used to calculate the current unknown point coordinates, the schematic diagram is shown in Figure 2.
Although it is relatively simple to use Equation (5) to calculate the coordinates, because the RSSI signal is affected by various environmental factors, there will be large signal fluctuations and thus low positioning reliability regardless of the distance from the iBeacon signal source. The weighting method in Equation (5) cannot reduce the error caused by this low credibility of the short-distance signal source. This paper therefore constructs a new weight matrix in Equation (5) according to the signal anomaly rates, and uses the nonlinear least squares LM algorithm to solve the positioning coordinates under the constraints of this weight matrix.

2.3. Anomaly Detection and Isolation Forest

The RSSI value of iBeacon’s Bluetooth signal is susceptible to fluctuations due to environmental interference during the collection process. To obtain high-precision positioning results, it is necessary to discover and eliminate abnormal RSSI in time. In other words, it is often necessary to eliminate outliers within a few seconds when performing indoor positioning and navigation. The relatively small amount of data available in these timescales makes the conventional robust estimation, Gaussian filtering, and other methods less effective [22].
This paper uses the isolation forest algorithm proposed by Zhou Zhihua et al. (2008) [18] for abnormal signal detection. This algorithm can achieve better anomaly detection results even with a small amount of data.
The basic idea of the isolation forest algorithm is to use several random planes to cut the data space repeatedly until there is only one data point in each data space. The specific process of anomaly detection is as follows [18].
(I) Randomly select ψ samples from all the data as the training subsample, and put it into the root node of the tree.
(II) Specify a dimension and randomly generate a plane cutting point Q within the range of the current node data. The range of the cutting point is between the maximum and minimum values of the training subsample.
(III) A plane is generated at the cutting point Q, and the data space of the current node is divided into two subspaces: put the points less than Q in the currently selected dimension on the left branch of the current node, and put the points greater than or equal to Q in the branch to the right of the current node.
(IV) Repeat steps II and III on the left and right branch nodes of the node, and continue to construct new leaf nodes until there is only one datum on the leaf node, or the tree has grown to the set maximum height.
(V) After constructing T isolation trees with the training subsamples, for each RSSI value in the entire data that needs anomaly detection, make it traverse the generated T isolation trees, and calculate the results in the T isolation trees. The average depth of each RSSI value is used to calculate the outlier of each RSSI value, where the outlier is defined as in Equation (6):
S ( RSSI ) = 2 - E ( h ( RSSI ) ) c ( ψ )
where E ( h ( RSSI ) ) is the average depth of a certain RSSI value in T isolation trees, and c ( ψ ) is the average value of the path length of the isolation tree generated by the training sample ψ .
(VI) Using Equation (6) and the isolation trees generated by training, calculate the S ( RSSI ) of the RSSI values broadcast by different iBeacons in turn. If the S ( RSSI ) is closer to 1, it is considered to be a signal outlier.
As shown in Figure 3, taking the RSSI value 0.2 m away from an iBeacon base station in the experimental scene as an example, RSSI 1 only needs one plane cut to make it the only datum in the space, whereas RSSI 2 needs to be cut six times to make it the only datum in the space. RSSI 1 is therefore considered to be the abnormal signal value within that group of data. According to this principle, and combined with Equation (6), anomaly detection can be performed on all the collected RSSI signals. Of course this is just an ideal situation. Only one segmentation strategy was used to detect abnormal signals. In fact, a variety of segmentation strategies needs to be used in the experimental part, and finally the score is calculated according to Equation (6), which is used to determine whether a signal value should be defined as an outlier.
Compared with other methods, using the isolation forest algorithm to perform anomaly detection on the received RSSI has the following advantages. (1) The ability to perform anomaly detection unsupervised, thereby detecting anomalies in continuous data without prior data. (2) The amount of calculation is small, and distributed training and calculation can be realized well. (3) It has good effect and stability for data sets with small data volume and low data dimensions. This algorithm is therefore suitable for rapidly (i.e., within a few seconds) detecting abnormalities within the RSSI signals received from each iBeacon base station in an indoor location. Abnormally fluctuating signals can be detected in a relatively short time, and the abnormal rate of each signal source in that time period can be calculated. The equation for calculating the abnormal rate is as in Equation (7):
α = Abnormal   signals All   signals

2.4. LM Optimization with Weighted Anomaly Rate

When using Equation (5) to solve the coordinates, if the equation is directly linearized, a certain error will be generated in the model. We therefore used the LM algorithm to solve the coordinates iteratively. From Equation (1), the plane coordinate solution model (8) and (9) can be obtained:
f i ( Y , X ) = ( Y y i ) 2 + ( X x i ) 2 = D i
D i ( Y y i ) 2 + ( X x i ) 2 = 0
Furthermore, Equation (9) can be written as solving Equation (10):
D i f i ( Y , X ) = 0
The LM algorithm is an improved Gauss-Newton method [23], and its iterative solution equation is as in Equation (11):
x s + 1 = x s + Δ
where x s is the plane coordinate vector [ Y , X ] T to be solved, ( x i , y i ) are the plane coordinates from every iBeacon base station involved in the coordinate solution, and D i is the spatial distance between the coordinate position to be solved and the iBeacon base station, which can be calculated by Equation (4). Furthermore, in order to find the optimal solution coordinates, the sum of squares S ( x ) = ε T ε of the residual vector ε = D i f i ( Y * , X * ) should be minimized, as shown in Equation (12).
( Y * , X * ) = arg min S ( x )
The LM approach then performs a Taylor expansion of Equation (10) at ( Y , X ) = ( Y k , X k ) , and omits terms of the second order and above so as to get the iterative formula of Equation (13):
Δ = ( J f T J f + μ I ) 1 J f T ε f
where J f is the Jacobian matrix of the function. For the i iBeacon base station signal sources, J f can be expressed as in Equation (14), I is the identity matrix of the coordinate vector to be solved, and ε f is the residual vector matrix of each iteration, which can be calculated as in Equation (15):
J f = [ f 1 Y , f 1 X f i Y , f i X ]
ε ( Y k , X k ) = f i ( Y k , X k ) D i
The μ in Equation (13), meanwhile, is the damping coefficient. When μ is small, the iteration process becomes the Gauss–Newton method of iteration, which has second-order convergence. When μ is large, on the other hand, the iteration process follows the gradient descent method, and the iteration converges quickly, the damping coefficient can be controlled by the Equation (16):
ρ = f ( x k ) f ( x k + h ) L ( 0 ) L ( h )
where h is the iteration step size, and L ( 0 ) L ( h ) is as in Equation (17).
L ( 0 ) L ( h ) = h T J T f 1 2 h T J T J h
In the iterative process, the damping coefficient μ is adjusted through ρ , then the current iterative solution process is selected. When the iteration terminates at x s + 1 x s < λ , the coordinate solution is completed, and λ is a minimal value. The method for determining the initial damping coefficient of the iteration is μ 0 = max { ( J f T J f ) i i } .
It can be seen that the iterative solution of Equation (13) is not weighted, that is, the weight of the signal data of each iBeacon base station participating in the coordinate calculation is the same. In reality, however, the signal quality of different iBeacon base stations is different and thus the overall precision of the positioning can be improved by assigning different weights to iBeacon base stations. Accordingly, we add a weight matrix based on Equation (13) in combination with the anomaly detection results described in Section 2.3 to obtain Equation (18):
Δ = ( J f T P J f + μ I ) 1 J f T P ε f
where the weight matrix is constructed by Equation (19):
p i = β i RSSI i 2
where RSSI i is the mean value of the i-th iBeacon base station after removing the abnormal values within a period of time, and β i can be expressed by Equation (20):
β = normalization { 1 α 1 , 1 α 2 1 α i }
α i can be obtained through Equation (7). According to Equation (20), the non-abnormal rate of each signal source is normalized. In other words, the iBeacon base stations at the location are sorted according to the fluctuations within a given period of time, and weights are assigned according to their abnormal rates. The optimal coordinates of the current point can be solved iteratively through Equations (11), (16) and (19) using the RSSI values of each iBeacon base station collected over that same period of time.

3. Experiment

The location for the experiment was an indoor venue with a size of around 92 m × 23 m. The experiment was mainly carried out in a corridor area, which had a minimum width of 2.4 m. We used a Xiao MI mi6 smartphone and its sensors for positioning. During our experiments, we held the smartphone horizontally in both steady and swaying states. The parameters and settings for the iBeacon base stations are shown in Table 2.
First, in order to obtain the specific values of A and n in the trilateration model, we set up an iBeacon base station at a fixed location in the test scene, and collected the RSSI values for a period of time at a fixed distance from the base station. Data were collected between 0.3 m and 10.2 m away from the base station, with an interval of 0.3 m. After using the isolation forest algorithm to detect anomalies and eliminate the abnormal signals, the signal strength values collected at each fixed distance were averaged in order to obtain the RSSI corresponding to the current distance. Then, the distance measurement model was fitted under the optimization of the nonlinear least squares algorithm (Figure 4). After identifying and eliminating the abnormal RSSI data at each fixed point, model fitting was performed, and the parameters A n and n in the ranging model were obtained by fitting with A n = −71.58 dBm, n = 2.647. It is worth noting that the fitting method used in this article is the least squares method. More specifically, it is the same as the method used in positioning solution: LM algorithm. As shown in Figure 4, this paper has achieved a good fitting effect based on Equation (4). Obviously, there are no data over fitting phenomenon. Besides, the anomaly detection results at 0.3 m and 9 m from the iBeacon station are shown in Figure 5. It can be clearly seen from Figure 5 that the signal anomaly rate at 9 m was significantly (1.54 times) higher than that at 0.3 m (the abnormal rate at 0.3 m is 13.11%, and that at 9 m is 20.23%). It was therefore necessary to perform real-time anomaly detection for each signal source in the process of positioning and solving.
After obtaining the specific A and n parameters required by the ranging model, we set up iBeacon base stations with the same parameters in 15 fixed locations on the experimental floor. At the same time, we planned the path of the experimental data collection (Figure 6). In the subsequent coordinate calculation process, we performed coordinate calculations at intervals of 0.6 m, and used this to calculate and compare positioning errors.
After completing the iBeacon layout and data collection path planning, we carried out data collection experiments along the route shown in Figure 6. Then, the collected RSSI was matched with the MAC address, so that each corresponded to its signal source iBeacon base station. A custom coordinate system was used, the origin point for the coordinates is shown in Figure 6, and the MAC address and coordinates of each iBeacon base station are shown in Table 3.
After preprocessing the collected data, i.e., performing the MAC and coordinate matching, we carried out anomaly detection on each group of data from different signal sources at 0.6 m steps according to the isolation forest algorithm described in Section 2.3. The anomaly rate of each group of data was calculated after eliminating the abnormal RSSI. For example, Figure 7 shows the original RSSI anomaly detection results received at the starting point from the iBeacon station B1 and the parallel data after the abnormal RSSI was eliminated.
Using the isolation forest algorithm for anomaly detection and calculating the anomaly ratio, the non-anomaly rate (trusted signal rate) was normalized and combined with the received RSSI to generate a weight matrix. Then, the weighted LM nonlinear least squares algorithm was used to calculate the coordinates of each point to be measured. The positioning results for an example point are shown in Figure 8. The valuation range in the figure refers to the coordinate area included in the 95% confidence interval. The coordinates at the center of that valuation range are chosen as the final positioning solution. As shown in Figure 8, the blue scale on the right represents the distance (m), and from small to high means an increase in distance.
According to the above method, the solutions for the 119 sets of data that were collected are shown in Figure 9. The error statistics are shown in Table 4.
It can be seen from the table that the maximum point position error is 3.527 m, the average value is 1.540 m, and the RMSE is 1.748 m. Among them, X, Y are the errors of the positioning results in the two vertical directions of the plane. About X, the Y direction as shown in Figure 6. The positioning accuracy obtained by the method proposed in this article is consistent with the current research status based on BLE technology (meter-level accuracy) [2], and is sufficient to meet the needs of indoor navigation and positioning. It is beneficial that the method proposed in this paper greatly improves the stability of positioning accuracy, which will be discussed in more detail in Part 4.

4. Discussion

In order to better verify the effect of this method in reducing positioning errors, we also designed three comparison algorithms: (A) no anomaly detection together with a weightless LM algorithm to generate the solution [24]; (B) anomaly detection of signals to remove outliers together with a weightless LM algorithm to generate the solution; and (C) no anomaly detection, only the RSSI value used to set the weight matrix and then a weighted LM algorithm used generate the solution [25]. The respective errors of these three positioning methods are shown in Table 5. The experimental positioning results of the three algorithms are shown in Figure 10.
Comparing Figure 9 and Figure 10, it is obvious that the settlement results for individual positioning points have large fluctuations in all the comparator methods. This phenomenon will inevitably affect the user’s experience during the navigation phase, especially the excessive errors in the calculated coordinate values.
Except for Method C, the error in the X direction is worse than the error in the Y direction. This is because Method C only uses RSSI values for weighting; this will cause a certain degree of change in the direction of error distribution when solving. In fact, it is not difficult to see from Table 5. The error difference of the method proposed in this article in the two directions is also smaller than that of methods A and B. However, this does not affect the requirements for actual use.
From Figure 10, it can be seen that the result obtained by using the positioning method proposed in this paper is the closest to the real planned path. By comparing Table 4 and Table 5, it can be clearly seen that, compared to the three comparator positioning solution methods, the weighted LM algorithm combined with anomaly detection proposed in this paper can reduce errors and improve positioning precision, in both the X or Y direction, or on the plane. Compared with the A, B, and C comparator methods, the method proposed in this paper reduces the Mean YX error by 36.42%, 33.88%, and 26.60% respectively, and the RMSE by 38.69%, 36.60%, and 29.52%, respectively. In addition, the algorithm proposed in this paper reduces the maximum error by 46.64%, 46.50%, and 38.71% in respect to methods A, B, and C, respectively. This shows that the use of isolation forest algorithm for anomaly detection can effectively and quickly detect the abnormal fluctuations of the received signal. Eliminating these abnormal signals can reduce the positioning error and improve the positioning precision. What is more, weighting according to the abnormal ratio of each different signal source can further reduce the error in coordinate calculation.
In order further to illustrate the superiority of the positioning method proposed in this paper, the error distribution histogram (Figure 11) and the cumulative distribution curves (Figure 12) of the four positioning algorithms are shown.
From Figure 11, it can be easily seen that the error of the method in this paper is relatively concentrated and the dispersion is small. Seventy percent of the errors are distributed between 0.5 m and 2 m, and 85.71% of the points can ensure that the plane error is less than 3 m, which is obviously better than any of the other three comparative algorithms. It can be seen from Figure 12 that the method proposed in this paper has a very high degree of improvement compared with method A. Among them, compared with the intermediate methods B and C, eliminating the abnormal RSSI value also played a role to a certain extent; however, it is not obvious. The greatest improvement comes from weighting based on the real-time status of each signal source. This shows that using only the RSSI value for weighting is indeed easy to ignore the real-time signal fluctuations of the iBeacon station at a close distance. The method proposed in this paper can improve this phenomenon well. It can be seen from Figure 12b, meanwhile, that the cumulative distribution curve of this method is basically above the other curves, indicating that the error value aggregation is better than with the other methods. With the method proposed in this paper, the probability of an error being within 3.6 m is 1, that is, all errors are less than 3.6 m, which is obviously smaller than with any of the other three methods.

5. Conclusions

In this paper, we propose an indoor positioning method that detects anomalies in the RSSI of iBeacon signals, eliminates the detected RSSI anomaly, and then sets a weight matrix based on the detected anomaly rate and the RSSI. Under the constraints of this weight matrix, the LM algorithm is used for coordinate calculation. Using this method eliminates the need to establish a fingerprint database before application, and it can ensure lower error and higher positioning precision. Experiments prove that the average point error of the method proposed in this paper is 1.540 m and the RMSE is 1.748 m. Furthermore, in all coordinate points of the solution, the error can be controlled within 3.6 m, and in 85.71% of cases the point error is less than 3 m.
At the same time, in order to better compare the effects of the method proposed in this paper on error control and precision improvement, we have calculated the coordinate error of three other methods. Compared with using the LM algorithm to solve the coordinates without anomaly detection and without setting the weight matrix, the RMSE is reduced by 38.69%. Compared with only using the isolation forest algorithm to detect and eliminate the error, it is reduced by 36.60%, and compared to eliminating outliers but only using RSSI to construct the weight matrix, RMSE reduced by 29.52%. The mean error by the method proposed in this paper is also the lowest. This proves that the algorithm in this paper has the following advantages.
(1) Abnormal signal fluctuations can be detected in a short time, and the positioning coordinates can be solved in time according to the state of different signal sources, with good positioning precision.
(2) While ensuring the overall positioning precision, the loss of positioning accuracy caused by signal fluctuations is greatly improved.

Author Contributions

All authors conceived and designed the study. Y.G. is a Master student that performed all development work. J.Z. is thesis supervisor and organized all work in the computer science subject, W.Z., G.X., and S.D. participated in scene setting, data acquisition, data processing and analysis. All authors contributed to the result analysis and discussions. All authors have read and agreed to the published version of the manuscript.


This research received no external funding.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The data presented in this study are available on request from the corresponding author. The data are not publicly available due to privacy.


The author thanks the Infrastructure Department of Nanjing Forestry University for providing some plane drawings of the experimental area.

Conflicts of Interest

The authors declare no conflict of interest.


  1. Xiao, H.; Zhang, H.; Wang, Z.; Gulliver, T. An RSSI based DV-hop algorithm for wireless sensor networks. In Proceedings of the IEEE Pacific Rim Conference on Communications, Computers, and Signal Processing (PACRIM), Victoria, BC, Canada, 21–23 August 2017; pp. 1–6. [Google Scholar]
  2. He, S.; Chan, S.H.G. Wi-Fi Fingerprint-Based Indoor Positioning: Recent Advances and Comparisons. IEEE Commun. Surv. Tutor. 2016, 18, 466–490. [Google Scholar] [CrossRef]
  3. Chen Ruizhi, C.L. Indoor Positioning with Smartphones: The State-of-the-art and the Challenges. Acta Geod. Cartogr. Sin. 2017, 46, 1316. [Google Scholar]
  4. Alarifi, A.; Al-Salman, A.; Alsaleh, M.; Alnafessah, A.; Al-Hadhrami, S.; Al-Ammar, M.A.; Al-Khalifa, H.S. Ultra wideband indoor positioning technologies: Analysis and recent advances. Sensors 2016, 16, 707. [Google Scholar] [CrossRef] [PubMed]
  5. Fard, H.K.; Chen, Y.; Son, K.K. Indoor positioning of mobile devices with agile iBeacon deployment. In Proceedings of the 2015 IEEE 28th Canadian Conference on Electrical and Computer Engineering (CCECE), Halifax, NS, Canada, 3–6 May 2015; pp. 275–279. [Google Scholar]
  6. Dogan, O.; Bayo-Monton, J.L.; Fernandez-Llatas, C.; Oztaysi, B. Analyzing of gender behaviors from paths using process mining: A shopping mall application. Sensors 2019, 19, 557. [Google Scholar] [CrossRef] [PubMed][Green Version]
  7. Lin, X.Y.; Ho, T.W.; Fang, C.C.; Yen, Z.S.; Lai, F. A mobile indoor positioning system based on iBeacon technology. In Proceedings of the 37th Annual International Conference of the IEEE Engineering in Medicine and Biology Society (EMBC), Milan, Italy, 31 October–4 November 2015; pp. 4970–4973. [Google Scholar]
  8. Pivato, P.; Palopoli, L.; Petri, D. Accuracy of RSS-Based Centroid Localization Algorithms in an Indoor Environment. IEEE Trans. Instrum. Meas. 2011, 60, 3451–3460. [Google Scholar] [CrossRef][Green Version]
  9. Yang, Z.; Liu, Y. Quality of Trilateration: Confidence-Based Iterative Localization. IEEE Trans. Parallel Distrib. Syst. 2010, 21, 631–640. [Google Scholar] [CrossRef]
  10. Yan, L.; Hoeber, O.; Chen, Y. Enhancing WiFi fingerprinting for indoor positioning using human-centric collaborative feedback. Hum. Centric Comput. Inf. Sci. 2013, 3, 2. [Google Scholar]
  11. Tapie, J.; Monnier, J.; Garipuy, J.; Delaude, A.; Bouissou, H. WLAN Positioning Systems: Principles and Applications in Location-Based Services; Cambridge University Press: Cambridge, UK, 2012. [Google Scholar]
  12. Jang, B.; Kim, H. Indoor positioning technologies without offline fingerprinting map: A survey. IEEE Commun. Surv. Tutor. 2019, 21, 508–525. [Google Scholar] [CrossRef]
  13. Cui, X.; Yu, K.; Lu, S. Approximate closed-form tdoa-based estimator for acoustic direction finding via constrained optimization. IEEE Sens. J. 2018, 18, 3360–3371. [Google Scholar] [CrossRef]
  14. Li, H. Low-cost 3D bluetooth indoor positioning with least square. Wirel. Pers. Commun. 2014, 78, 1331–1344. [Google Scholar] [CrossRef]
  15. Jondhale, S.R.; Deshpande, R.S. Modified Kalman filtering framework based real time target tracking against environmental dynamicity in wireless sensor networks. Ad Hoc Sens. Wirel. Netw. 2018, 40, 119–143. [Google Scholar]
  16. Nan, Z.; Hongbo, Z.; Wenquan, F.; Zulin, W. A novel particle filter approach for indoor positioning by fusing wifi and inertial sensors. Chin. J. Aeronaut. 2015, 28, 1725–1734. [Google Scholar]
  17. Liu, J.H.; Xu, D.P.; Yang, X.Y. Multi-objective power control of a variable speed wind turbine based H∞ on theory. In Proceedings of the 2008 International Conference on Machine Learning and Cybernetics, Kunming, China, 12–15 July 2008. [Google Scholar]
  18. Liu, F.T.; Ting, K.M.; Zhou, Z.H. Isolation-based anomaly detection. ACM Trans. Know Disc. Data 2012, 6, 1–39. [Google Scholar] [CrossRef]
  19. Marquardt, D.W. An algorithm for least-squares estimation of nonlinear parameters. J. Soc. Ind. Appl. Math. 1963, 11, 431–441. [Google Scholar] [CrossRef]
  20. Rida, M.E.; Liu, F.; Jadi, Y.; Algawhari, A.A.; Askourih, A. Indoor location position based on bluetooth signal strength. In Proceedings of the 2015 2nd International Conference on Information Science and Control Engineering, ICISCE 2015, Shanghai, China, 24–26 April 2015; pp. 769–773. [Google Scholar]
  21. Akl, R.; Tummala, D.; Li, X. Indoor propagation modeling at 2.4 GHz for IEEE 802.11 networks. In Proceedings of the Sixth IASTED International Multi-Conference on Wireless and Optical Communications: Conference on Wireless Networks and Emerging Technologies, Banff, AB, Canada, 3–5 July 2006. [Google Scholar]
  22. Gwon, Y.; Jain, R.; Kawahara, T. Robust indoor location estimation of stationary and mobile users. In Proceedings of the IEEE INFOCOM 2004, Hong Kong, China, 7–11 March 2004; Volume 2, pp. 1032–1043. [Google Scholar]
  23. Sotenga, P.Z.; Djouani, K.; Kurien, A.M.; Mwila, M.M. Indoor localization of wireless sensor nodes towards internet of things. Procedia Comput. Sci. 2017, 109, 92–99. [Google Scholar] [CrossRef]
  24. Zhang, R.; Zhong, W.D.; Kemao, Q. In A singular value decomposition-based positioning algorithm for indoor visible light positioning system. In Proceedings of the 2017 Conference on Lasers and Electro-Optics Pacific Rim (CLEO-PR), Singapore, 31 July–4 August 2017. [Google Scholar]
  25. Subedi, S.; Kwon, G.-R.; Shin, S.; Hwang, S.; Pyun, J.-Y. Beacon based indoor positioning system using weighted centroid localization approach. In Proceedings of the 2016 Eighth International Conference on Ubiquitous and Future Networks (ICUFN), Vienna, Austria, 5–8 July 2016; pp. 1016–1019. [Google Scholar]
Figure 1. The workflow of anomaly detection and positioning.
Figure 1. The workflow of anomaly detection and positioning.
Sensors 21 00120 g001
Figure 2. Trilateration using three iBeacons.
Figure 2. Trilateration using three iBeacons.
Sensors 21 00120 g002
Figure 3. Isolation forest and spatial segmentation.
Figure 3. Isolation forest and spatial segmentation.
Sensors 21 00120 g003
Figure 4. Model fitting.
Figure 4. Model fitting.
Sensors 21 00120 g004
Figure 5. Anomaly detection: (a) Anomaly detection at 0.3 m. (b) Anomaly detection at 9 m
Figure 5. Anomaly detection: (a) Anomaly detection at 0.3 m. (b) Anomaly detection at 9 m
Sensors 21 00120 g005
Figure 6. Collection path and iBeacons.
Figure 6. Collection path and iBeacons.
Sensors 21 00120 g006
Figure 7. iBeacon “EB:CF:D1:9D:98:9F” RSSI at Start Point.
Figure 7. iBeacon “EB:CF:D1:9D:98:9F” RSSI at Start Point.
Sensors 21 00120 g007
Figure 8. Coordinates solution.
Figure 8. Coordinates solution.
Sensors 21 00120 g008
Figure 9. Positioning results.
Figure 9. Positioning results.
Sensors 21 00120 g009
Figure 10. Positioning results for the comparator methods.
Figure 10. Positioning results for the comparator methods.
Sensors 21 00120 g010
Figure 11. Error distribution frequencies: (a) Error frequency of A; (b) Error frequency of B; (c) Error frequency of C; (d) Error frequency of method in this paper.
Figure 11. Error distribution frequencies: (a) Error frequency of A; (b) Error frequency of B; (c) Error frequency of C; (d) Error frequency of method in this paper.
Sensors 21 00120 g011
Figure 12. Error comparison discussion, (a) Error improvement; (b) Cumulative distribution functions of the localization error for the four methods.
Figure 12. Error comparison discussion, (a) Error improvement; (b) Cumulative distribution functions of the localization error for the four methods.
Sensors 21 00120 g012
Table 1. Trilateration and fingerprinting.
Table 1. Trilateration and fingerprinting.
iBeacon collaborationYesYes
Fingerprint database and coordinate matchingNoYes
Distance estimation modeYesNo
Implementation complexity and costLowHigh
Table 2. iBeacon base station settings.
Table 2. iBeacon base station settings.
Size39 mm × 39 mm
Time interval100 ms
Coverage radius80 m
Nominal signal at 1 m−65 dBm
Battery life2–3 years
Table 3. iBeacons’ MAC and Coordinates.
Table 3. iBeacons’ MAC and Coordinates.
Table 4. Errors in positioning using anomaly detection and weighted LM algorithm.
Table 4. Errors in positioning using anomaly detection and weighted LM algorithm.
Error (m)
Max Error S3.527
Mean Error S1.540
RMSE S1.748
Max Error |Y|2.346
Mean Error |Y|0.579
RMSE Y0.766
Max Error |X|3.570
Mean Error |X|1.290
RMSE X1.571
S = ( y p y r ) 2 + ( x p x r ) ( ( y p , x p ) : positioning result, ( y r , x r ) : real coordinate).
Table 5. Errors of comparative methods.
Table 5. Errors of comparative methods.
Mthod in This Paper (m)Error of A (m)Error of B (m)Error of C (m)
Max Error S3.5276.616.5925.755
Mean Error S1.5402.4222.3292.098
RMSE S1.7482.8512.7572.480
Max Error |Y|2.3463.7473.7135.560
Mean Error |Y|0.5790.5930.5641.758
RMSE |Y|0.7660.9020.8652.193
Max Error |X|3.5706.4806.5704.916
Mean Error |X|1.2902.2252.1530.670
RMSE |X|1.5712.7042.6181.034
S = ( y p y r ) 2 + ( x p x r ) ( ( y p , x p ) : positioning result, ( y r , x r ) : real coordinate).
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Guo, Y.; Zheng, J.; Zhu, W.; Xiang, G.; Di, S. iBeacon Indoor Positioning Method Combined with Real-Time Anomaly Rate to Determine Weight Matrix. Sensors 2021, 21, 120.

AMA Style

Guo Y, Zheng J, Zhu W, Xiang G, Di S. iBeacon Indoor Positioning Method Combined with Real-Time Anomaly Rate to Determine Weight Matrix. Sensors. 2021; 21(1):120.

Chicago/Turabian Style

Guo, Yu, Jiazhu Zheng, Weizhu Zhu, Guiqiu Xiang, and Shaoning Di. 2021. "iBeacon Indoor Positioning Method Combined with Real-Time Anomaly Rate to Determine Weight Matrix" Sensors 21, no. 1: 120.

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop