A BLE Indoor Positioning Algorithm Based On Weighted Fingerprint Feature Matching Using AOA and RSSI
A BLE Indoor Positioning Algorithm Based On Weighted Fingerprint Feature Matching Using AOA and RSSI
1. Southeast University
2. Nanjing West Aware Co., Ltd
3. Nanjing Zgmicro Co., Ltd
Email: {sunda,wwxia,zygeng,feng.yan,lfshen}@seu.edu.cn, [email protected],
[email protected]
Abstract—As a kind of indoor positioning technology, Blue- through positioning errors. Reference [11] creates a dataset
tooth Low Energy (BLE) has the characteristics of low power with values from Bluetooth RSSI and trains the neural network
consumption, low cost, high accuracy, etc. In Bluetooth Spec- model to predict the distance from a specific Beacon. After
ification 5.1, the Angel of Arrival and Angel of Departure
methods (AOA&AOD) method is introduced in order to get that it uses the predicted distances to find the intersection
better positioning accuracy. However, in the actual environment, points and uses the Geometric median of these points as the
factors such as signal interference and antenna directivity will final location estimation. Finally, the average error is 69.58cm.
cause the angle information to be inaccurate and lead to large In [12], support vector machines (SVM) is first trained with
positioning errors. Therefore, this paper proposes a weighted the RSSI samples at various radio mapping points. Once the
fingerprint feature matching algorithm using AOA and RSSI
(WFFMA) to improve positioning accuracy. In the fingerprint system is trained, it can estimate the probability of being at
database establishment stage, Natural Breaks (NB) classification each radio map and use the probability to estimate the location
is introduced to extract features as fingerprint values. Then of a mobile device. The system has an average error of 50cm.
Random Forest (RF) is used to train the weight of each feature. As shown above, most Bluetooth positioning methods only
In the online matching stage, improved K-nearest-neighbor uses RSSI value as the indicator of position estimation and
(KNN) method is proposed to get the predicted coordinates.
The proposed WFFMA is verified through experiments based there are more or less drawbacks, such as the need for a large
on the hardware platform. The experimental results show that number of base stations, insufficient accuracy, etc. In the 5.1
the accuracy of the proposed algorithm is improved significantly, version of Bluetooth Specification, AOA & AOD method is
compared with existing traditional algorithms. proposed. As illustrated in [13], the estimation locator listens
Index Terms—BLE, AOA, Random Forest, fingerprint posi- for the Constant Tone Extension (CTE) packet and measures
tioning, RSSI
the In-Quadrature (IQ) samples based on which the angle
calculation has been performed. Using the concept of multiple
I. I NTRODUCTION
angle intersection, the receiver’s location is calculated. How-
In recent years, the development of positioning technology ever, there are several issues including Carrier Frequency Off-
is in full swing, location-based-service (LBS) [1] has grad- set (CFO), multipath effect, Inter-Symbol Interference (ISI),
ually penetrated into human production and life, especially noise, and phase shifting faced by the AoA [14]. The Bluetooth
indoor. People are searching for high-precision and high- AOA feature combined with the RSSI, will make BLE a
reliability indoor positioning technology. Currently, commonly very accurate indoor positioning system (IPS) with sub-meter
used wireless positioning measurement methods include TOA, accuracy [13].
TODA, and RSSI [2]–[4]. According to these positioning Therefore, in this paper, a weighted fingerprint feature
methods, a variety of indoor positioning technologies have matching algorithm using AOA and RSSI (WFFMA) is pro-
been derived, including the following mainstream indoor po- posed, the contirbutions of our work can be concluded as
sitioning technologies, ultra-wideband (UWB) [5], WIFI [6], follows :
and Bluetooth [7]. Among them, Bluetooth has the advantages • The proposed WFFMA includes the offline training and
of low cost, low power consumption, small size, high compat- database establishment stage and online matching stage
ibility, etc. Therefore, Bluetooth positioning [8] is one of the of WFFMA.
main research directions of indoor positioning. • In the offline stage, Natural Breaks classification is in-
BLE beacons are used in [9] to produce a radio map (RSSI) troduced in to extract fingerprint values, and Random
in advance and KNN [10] is applied, where the localization Forest is adopted to train the weight of each feature when
accuracy is around 1 meter, which is considered acceptable establishing fingerprint database.
value. Machine learning is a popular research point to break • In online stage, improved KNN (IKNN) algorithm is
Authorized licensed use limited to: Korea Advanced Inst of Science & Tech - KAIST. Downloaded on May 09,2023 at 10:55:14 UTC from IEEE Xplore. Restrictions apply.
proposed. AOA and RSSI values are used as fingerprint
Start
values, and each feature is multiplied by the weight
trained in the offline stage to calculate the predicted Offline Stage Online Stage
position. Feature
• Our proposed algorithm is verified on the hardware plat- Data collection Weights
Training
Data Collection
In our system, an area is firstly selected, and there are Fig. 1: The structure of WFFMA
K reference points. Assuming that B base stations (BS) are
deployed, the tag device (S) to be positioned is placed in 2) Fingerprint Database Establishment: The establishment
this area. Then AOA and RSSI between S and each BS of fingerprint database is to preprocess and calculate AOA
are measured, and AOA and RSSI are denoted as a and r and RSSI values to obtain the fingerprint value af and rf . The
respectively. fingerprint vector at the same reference point will be different,
In this section, WFFMA is proposed to improve the accu- mainly for two reasons: First, the time of data collection is
racy of BLE indoor positioning. The structure of WFFMA different. Second, the channel conditions are different, and the
is shown in Figure 1. WFFMA includes offline stage and degree of interference to the signal is different.
online stage. In the offline stage, AOA and RSSI values are In order to solve these problems, this paper proposes a
first collected from the BSs. After preprocessing a and r, the method based on Natural Breaks classification to determine
Natural Breaks classification method is used for extracting each af , rf and dk . The specific steps are as follows.
fingerprint values as af and rf , and the fingerprint vector of Step1. First, ai (n) is limited to a specific range, and then
kth reference point is represented as dk (k ranges from 1 to extreme values in ai and ri are removed based on statistic 2-
T
K). Then the database is established and denoted as D. Then sigma criteria, where ai = [ai (1) , . . . , ai (n) , . . . , ai (N )] ,
T
we use Random Forest to train the weight of each feature ri = [ri (1) , . . . , ri (n) , . . . , ri (N )] .
and get weight vector as V IM . In the online stage, after Step2. Natural Breaks classification is a clustering algorithm
pre-processing and extraction, online matching vector d is and divides the elements of ai and ri into G groups. For
obtained and matched
by proposed IKNN to get the predicted convenience, we define xj = ai ∪ ri , j = 1, 2, . . . , 2B. First,
∧ ∧ we calculate the mean squared error (MSE) of xj , denoted as
position x, y .
A. Then, all elements of xj are sorted and iteratively divided
to different groups. The MSE of each group is calculate and
A. Offline stage the sum of them is obtain, which is represented as S.
N
The offline stage consists mainly of three parts, as shown 1
2
A= (xj (n) − xj ) (2)
below: N n=1
1) Data Collection: Assuming that N AOA and RSSI Ng
G
are collected at each reference point and are sorted into the 1
2
S= (xg (q) − xg ) (3)
following form: N g
g=1 q=1
⎡ ⎤
a1 (1) r1 (1) · · · aB (1) rB (1) In Equation (3), xg is the average value of xj (n) in gth
⎢ a1 (2) r1 (2) · · · aB (2) rB (2) ⎥ group, g = 1, 2, . . . , G. Ng is the amount of xj (n) in gth
Fk = ⎢⎣ ···
⎥ (1)
··· ··· ··· ··· ⎦ group, and xg (q) is qth value in gth group.
a1 (N ) r1 (N ) · · · aB (N ) rB (N ) Finally, the evaluation index E in Equation (4) is cal-
culated, the optimal grouping with the maximum E is de-
In Equation (1), ai (n)/ri (n) represents the nth AOA/RSSI termined and the boundries of G groups are obtained as
collected by the ith base station at the kth reference point. b = {b1 , . . . , bg , . . . , bG+1 }.
i = 1, 2, . . . , B and n = 1, 2, . . . , N , where N is the number S
of AOA/RSSI. E =1− (4)
A
Authorized licensed use limited to: Korea Advanced Inst of Science & Tech - KAIST. Downloaded on May 09,2023 at 10:55:14 UTC from IEEE Xplore. Restrictions apply.
Step3. After classifying the data into G groups, the bound- Features xj ’s Gini importance in RF, that is, the normalized
aries b are obtained. After that, xj (n) ∈ [bg , bg+1 ) belonging value of importance on all nodes, is defined as:
to gth group is counted, when g = G, xj (n) = bG+1 is also T
included in Gth group. The number of xj (n) belonging to 1
¬ª fi 1 } fi n } f i N º¼ , i 1, 2,
T
⎩ xf = w g μg Fi ,K
g=1
Original training sample set
Finally, the fingerprint vector dk of the kth reference point
can be expressed as:
dk = [af1 , rf1 , . . . , afB , rfB ] , k = 1, 2, . . . , K (6) subsample subsample
ĂĂ
subsample
set 1 ĂĂ set t set T
The whole fingerprint database can be expressed as:
T
D = [d1 , d2 , . . . , dK−1 , dK ] (7)
3) Feature weigths training through Random Forest: Ran-
ĂĂ ĂĂ
dom Forest is an algorithm that integrates multiple trees and
its basic unit is a decision tree. It is not only excellent in
accuracy, but can also give estimations of what features are
important in the classification.
First, we convert Equation (1) to the following format, Tree 1 ĂĂ Tree t ĂĂ Tree T
where fk (n) represent all the xj (n) (j ∈ [1, 2B]) collected at
the ith reference point.
∧ T Fig. 2: The formation of Random Forest
Fk = fk (1) . . . fk (n) . . . fk (N ) (8)
RF randomly selects the subsample set S1 , . . . , St , . . . , ST
B. Online stage
from fk (n) repeatedly. Then classification trees are generated
to form RF, T is the number of trees, t = 1, 2, . . . , T . The Conventional KNN and WKNN [15] methods have equal
formation of Random Forest is shown in Figure 2. weights for each fingerprint value. In the proposed IKNN,
According to Gini index in Equation (9), at each node, the we introduces the weight vector V IM in Equation (13).
variable that minimizes the Gini index is selected as the branch After obtaining the online representative vector d =
variable, and splited into the left node and the right node. [x1 , x2 , . . . , x2B−1 , x2B ], we calculate weighted euclidean dis-
tance as Equation √ (14), which represents the dot product of
K
∧ ∧ (dk − d) and V IM .
GIm = pmk 1 − pmk (9) √
k=1
disk = V IM • (dk − d) (14)
∧
In (9), pmk is the estimated value of the probability that the
After sorting the Euclidean distances of all reference points,
sample on mth node belongs to the kth class, corresponding
a threshold ε is set in order to obtain the set of Euclidean
to the kth reference point. The score statistic of the feature
distances less than or equal to the threshold. The threshold is
xj is represented as V IMj (variable importance measures).
an optimal value determined through many experiments. As-
The difference of the Gini index before and after the branch
suming that there are U distances in φ, the average distances
of node m is denoted as V IMjm in Equation (10), where GIl
is calculated and represented as disi . Then the set of distances
and GIl respectively represent the Gini index of the left and
less than or equal to the mean value disi in set φ is selected,
right subtrees split by node m..
as shown in Equation (15).
V IMjm = GIm − GIl − GIr (10)
φ = {disk |disk <= ε }
If the feature xj occurs M times in the tree t, the importance
of the feature xj in the tree t is: 1
U
disk = U disku , disku ∈ φ (15)
M
u=1
V IMjt = V IMjm (11)
m=1 Φ = disk disk <= disk
Authorized licensed use limited to: Korea Advanced Inst of Science & Tech - KAIST. Downloaded on May 09,2023 at 10:55:14 UTC from IEEE Xplore. Restrictions apply.
∧The∧ coordinates of elements in set Φ are represented as
xz , yz , where z ∈ (1, Z) and Z is the number of elements
∧ ∧
in Φ. Finally, the predicted postion x, y is obtained through S e BS
Equation (16).
Z
∧ 1
x= xz
Z z=1
Z
(16)
∧ 1
Fig. 3: Angle range
y= yz
Z z=1
stations successively. Based on the steps in the offline stage
The whole process of IKNN is shown in Algorithm 1. of Section III, we obtain the fingerprint database and feature
weight vector according to Equation (7) and (13), respectively.
Algorithm 1 Algorithm of IKNN In the online stage, a coordinate point is randomly selected
Input: dk, d, V
IM in each 100 small areas of 0.5m*0.5m (in each grid in Figure
∧ ∧ 5), S is placed in these 100 points and connected with the
Output: x, y
base stations. Then according to the online stage of Section
1: Process the data acquired online and get the data veator III, we calculate the predicted coordinates in Equation (16) of
d √ each point and compare them with the actual coordinates to
2: Get the weight vector V IM in Eq.(13) √ calculate the error.
3: Calculate the dot product of (dk − d) and V IM at
each reference point, and get disk by Eq.(14)
4: Sort all disk y
5: Obtain the set of Euclidean distances less than or equal
to a threshold ε
M4
M4 M3
6: Select the distances less than or equal to the mean value
disi , and combine them as a new set Φ by Eq.(15)
7: Calculate the average of the corresponding
coordinates in
∧ ∧
set Φ as the predicted position x, y by Eq.(16) S
∧ ∧
8: return x, y
Authorized licensed use limited to: Korea Advanced Inst of Science & Tech - KAIST. Downloaded on May 09,2023 at 10:55:14 UTC from IEEE Xplore. Restrictions apply.
base stations. In our experiment, we first use only two base
stations (M1 and M2) and tag device (S). Then the error values
between the predicted coordinates and the actual positions of
100 points online are calculated, and the numbers of points
within the range every 0.1m is counted. Then, we increase the
number of BSs to four.
Authorized licensed use limited to: Korea Advanced Inst of Science & Tech - KAIST. Downloaded on May 09,2023 at 10:55:14 UTC from IEEE Xplore. Restrictions apply.
[6] P. Danklang and T. Pranekunakol, ”An RSSI-based weighting with
accelerometers for real-time indoor positioning,” 2021 13th International
Conference on Knowledge and Smart Technology (KST), 2021, pp. 1-5.
[7] M. Ture and A. Hatipoglu, ”Indoor Location Finding of the Transmitter
Based on Bluetooth Received Signal Strength,” 2019 International
Symposium on Networks, Computers and Communications (ISNCC),
2019, pp. 1-5.67123
[8] H. Subakti, H. -S. Liang and J. -R. Jiang, ”Indoor Localization with
Fingerprint Feature Extraction,” 2020 IEEE Eurasia Conference on IOT,
Communication and Engineering (ECICE), 2020, pp. 239-242.
[9] S. G. Obreja and A. Vulpe, ”Evaluation of an Indoor Localization Solu-
tion Based on Bluetooth Low Energy Beacons,” 2020 13th International
Conference on Communications (COMM), 2020, pp. 227-231.
[10] M. Taha, R. Atallah, O. Dwiek and F. Bata, ”Crowd Estimation Based on
RSSI Measurements Using kNN Classification,” 2020 3rd International
Conference on Intelligent Autonomous Systems (ICoIAS), 2020, pp. 67-
70.
[11] K. Kotrotsios and T. Orphanoudakis, ”Accurate Gridless Indoor Local-
ization Based on Multiple Bluetooth Beacons and Machine Learning,”
2021 7th International Conference on Automation, Robotics and Appli-
Fig. 8: The RMSE of errors using different methods cations (ICARA), 2021.
[12] P. Sthapit, H. Gang and J. Pyun, ”Bluetooth Based Indoor Positioning
less than 1m is up to 95%. Based on the above comparison, Using Machine Learning Algorithms,” 2018 IEEE International Confer-
ence on Consumer Electronics - Asia (ICCE-Asia), 2018, pp. 206-212.
our proposed WFFMA algorithm has a lot of improvement [13] G. Kumar, V. Gupta and R. Tank, ”Phase-based Angle estimation
over the traditional algorithms. approach in Indoor Localization system using Bluetooth Low Energy,”
2020 International Conference on Smart Electronics and Communication
IV. D ISCUSSION AND FUTURE WORKS (ICOSEC), 2020, pp. 904-912.
[14] Z. Hajiakhondi-Meybodi, M. Salimibeni, A. Mohammadi and K. N.
In this paper, BLE indoor positioning algorithm is investi- Plataniotis, ”Bluetooth Low Energy-based Angle of Arrival Estimation
gated and a WFFMA algorithm is proposed to improve the in Presence of Rayleigh Fading,” 2020 IEEE International Conference
accuracy of indoor positioning. In our proposed WFFMA, on Systems, Man, and Cybernetics (SMC), 2020, pp. 3395-3400.
[15] F. Peng and J. Zhai, ”A WKNN/PDR/Map-Matching Integrated Indoor
both AOA and RSSI values are used to establish fingerprint Location Method,” 2018 IEEE 9th International Conference on Software
database based on Natural Breaks classification. Then the Engineering and Service Science (ICSESS), 2018, pp. 182-185.
weight of each feature is trained through Random Forest. [16] Z. Hao, B. Li and X. Dang, ”An improved Kalman filter positioning
method in NLOS environment,” in China Communications, vol. 16, no.
Finally, based on KNN, we propose an improved KNN, taking 12, pp. 84-99, Dec. 2019, doi: 10.23919/JCC.2019.12.006.
into account the influence of different characteristics on the
matching results. Finally, it is verified through experiments
that WFFMA has higher accuracy than traditional algorithms.
In the future, our work will start from the underlying IQ data to
make the AOA angle of hardware measurement more accurate.
ACKNOWLEDGMENT
This work are supported by the National Natural Science
Foundation of China (No. 61741102, U1805262) and the
Specialized Development Foundation for the Achievement
Transformation of Jiangsu Province (BA2019025).
R EFERENCES
[1] M. Kenan, ”Comparative Analysis of Localization Techniques Used in
LBS,” 2021 5th International Conference on Computing Methodologies
and Communication (ICCMC), 2021, pp. 300-304.
[2] X. Zhu, W. Zhu and Z. Chen, ”Direct Localization Based on Motion
Analysis of Single-Station Using TOA,” 2018 2nd IEEE Advanced Infor-
mation Management,Communicates,Electronic and Automation Control
Conference (IMCEC), 2018, pp. 1823-1827.
[3] X. Zhou, C. Xu, J. He and J. Wan, ”A Cross-region Wireless-
synchronization - based TDOA Method for Indoor Positioning Appli-
cations,” 2019 28th Wireless and Optical Communications Conference
(WOCC), 2019, pp. 1-4.
[4] S. Barai, D. Biswas and B. Sau, ”Improved RSSI based Angle Localiza-
tion using Rotational Object,” 2020 International Conference on Power
Electronics and Renewable Energy Applications (PEREA), 2020, pp.
1-5.
[5] N. Petukhov, A. Chugunov, V. Zamolodchikov, D. Tsaregorodtsev and
I. Korogodin, ”Synthesis and Experimental Accuracy Assessment of
Kalman Filter Algorithm for UWB ToA Local Positioning System,”
2021 3rd International Youth Conference on Radio Electronics, Elec-
trical and Power Engineering (REEPE), 2021, pp. 1-4.
Authorized licensed use limited to: Korea Advanced Inst of Science & Tech - KAIST. Downloaded on May 09,2023 at 10:55:14 UTC from IEEE Xplore. Restrictions apply.