You are on page 1of 6

Rank Based Fingerprinting Algorithm for Indoor

Positioning


J. Machaj, P. Brida
Department of Telecommunications and Multimedia
University of Zilina
Zilina, Slovakia
juraj.machaj@fel.uniza.sk, peter.brida@fel.uniza.sk
R. Pich
Department of Mathematics
Tampere University of Technology
Tampere, Finland
robert.piche@tut.fi


Abstract A novel Received Signal Strength (RSS) rank based
fingerprinting algorithm for indoor positioning is presented.
Because RSS rank is invariant to bias and scaling, the algorithm
provides the same accuracy for any receiver device, without the
need for RSS calibration. Similarity measures to compare ranked
vectors are introduced and their impact on positioning accuracy
is investigated in experiments. Experimental results shown that
proposed algorithm can achieve better accuracy than commonly
used NN and WKNN fingerprinting algorithms.
Keywords- Indoor positioning; Fingerprinting; Localization
I. INTRODUCTION
The basic requirement for Location Based Services (LBS)
[1] is knowledge of the mobile device position. This can be
achieved in many different ways. Global Navigation Satellite
Systems (GNSS), like GPS (Global Positioning System) or
GLONASS (Global Navigation Satellite System), are widely
used, and these systems work very well for outdoors, especially
in areas with a clear view to the satellites. In dense urban
environments GNSS can suffer from high signal attenuations
and reflections, which can seriously degrade position estimate
accuracy. In indoor environment the situation is even worse, as
GNSS signals are mostly too weak to be received at all.
These drawbacks of GNSS have motivated the
development of positioning algorithms that use signals from
existing radio networks. These algorithms use different
properties of radio signals. Most common in indoor
environment are measurements of RSS (Received Signal
Strength) and ToA (Time of Arrival). The work presented in
this paper deals with RSS measurements, which have the
advantage that they are available on almost every device.
Indoor positioning systems can be based on different
wireless technologies, for example Bluetooth [2], UWB (Ultra
Wide Band) [3] and WiFi (IEEE 802.11) [4-8]. This work deals
with WiFi signals, because WiFi is the most common
technology and it is supported by a wide range of devices.
Most indoor positioning systems based on WiFi use some
kind of fingerprinting algorithm. In fingerprinting algorithms,
measured RSS values stored in a database (known as a radio
map) are compared to RSS values measured by the mobile
device. A basic difficulty here is that because of hardware and
software differences between different devices (even devices of
the same make and model), the RSS reported by the mobile
device may differ from the RSS in the database, and this can
degrade the positioning accuracy [9].
One approach to dealing with this issue is to calibrate the
RSS scale and bias for the device, for example using a self-
calibration learning algorithm as proposed in [4].
In this paper we propose a novel fingerprint positioning
algorithm that uses only the rankings of the RSS values.
Because rank information is invariant to any monotonic
increasing transformation (bias and scale), the algorithm's
performance should be unaffected by the calibration of the
mobile device. Differences in bias and scale are given by
different hardware and software equipments of devices. It can
be caused for example by different gains of receivers and
antennas.
The rest of the paper is organized as follows. In the next
section related work in indoor positioning algorithms is
introduced. Section III describes the proposed rank based
algorithm. Similarity measures used in the algorithm are
described in Section IV. Results of tests in a real environment
are given in Section V and Section VI concludes the paper.
II. RELATED WORK
A. Rank based localization
Rank based localization in wireless networks was
introduced by Yedavalli et al. in [10]. Their Ecolocation
algorithm uses a set of constraints to estimate the position of a
mobile device. Measured RSS values from the APs (Access
Points) that are within range are sorted and compared with
constraints. Position is estimated as the centroid of points with
the highest number of satisfied constraints.
An improved version of the Ecolocation algorithm was
introduced in [11]. Bisector lines were introduced as lines
connecting points with the same RSS values from two different
APs. These lines in fact divide area into areas based on RSS
values achieved from propagation model. Position is estimated
as a weighted mean of positions with the highest number of
978-1-4577-1804-5/11/$26.00 2011 IEEE
satisfied constraints. Another modification of the algorithm
[12] uses the centroids of nearest three regions with the highest
number of satisfied constraints estimated by the previous
algorithm.
A drawback of these methods is their use of bisector lines,
because signal propagation in indoor environment, where there
are many obstacles, is not accurate and equal values of RSS
from two APs are not in a straight line.
B. Fingerprinting localization
In fingerprinting localization, the position of a mobile
device is estimated by comparison of measured RSS values and
RSS values stored in a radio map database. Fingerprinting
algorithms have two phases an offline learning phase and an
online operating phase.
In the offline phase, the radio map database is created. The
localization area is divided into small cells [6], and each cell is
represented by a reference point. RSS values from all APs
within range are measured and stored in the radio map, which
is a collection of data vectors that can be described as:
M j P
j N j
j
,..., 2 , 1 ) , ,..., (
1
= = u o o , (1)
where N
j
is the number of APs heard at the j-th reference point,
M is the number of reference points, o
i
are RSS values, and
parameter vector u
j
contains additional information that can be
used in the localization phase.
In the online phase the mobile device measures RSS values
from all APs within range. These values are compared to data
stored in the radio map database. Algorithms used for
comparison between RSS data from the two phases and
estimation of position of mobile device can be divided into two
main frameworks deterministic and probabilistic.
In the probabilistic (or statistical) framework the mobile
devices position is modeled as a random vector [13]. The
location candidate is chosen if its posterior probability is the
highest. The decision rule uses Bayes' theorem:

) (
) ( ) (
) (
S P
P S P
S P
i i
i

= , (2)
where posteriori probability P(
i
|S) is a function of likelihood
P(S|
i
), prior probability P(
i
) and observed evidence
) ( ) ( ) (
i i
i
P S P S P

= , vector S represents the observed RSS


values during online phase and
i
stands for i-th location
candidate.
The deterministic framework is based on optimizing the
similarity between the measurement and the fingerprints. The
position estimate is computed using the weighted average:

=
=

=
M
i
i
M
i
i i

x
1
1


, (3)
where
i
is a non-negative weighting factor. Weights can be
calculated as the reciprocal of the distance between RSS
vectors from online and offline phase. Usually the Euclidian
distance is used but different distance metrics are also possible
[14].
The estimator (3) which keeps the K largest weights and sets
the others to zero is called the WKNN (Weighted K-Nearest
Neighbor) method [7]. WKNN with all weights e
i
= 1 is called
the KNN (K-Nearest Neighbor) method. The simplest method,
where K = 1, is called the NN (Nearest Neighbor) method. In
[6] it was found that WKNN and KNN methods perform better
than the NN method, particularly when values of parameter K
are 3 or 4.
III. RANK BASED FINGERPRINTING
The main difference between conventional fingerprinting
algorithms and the proposed Rank Based Fingerprinting (RBF)
localization algorithm is the way in which measured data in
offline and online phases are compared and used to estimate
position. In classical fingerprinting algorithms, vectors of RSS
values measured in online and offline phase are directly
compared to each other.
In the proposed algorithm (Fig. 1) the RSS values measured
in the online phase from different APs are first sorted from
strongest to weakest. Then ranks are assigned to APs based on
their position in the sorted vector. To the first AP in sorted
vector is assigned rank value 1, to second AP value 2 is
assigned and so on rank value in fact represents position of
the AP in sorted vector. The sorted vector of APs detected in
the online phase is then compared to vectors stored in the radio
map.

Figure 1. Block diagram of proposed RBF algorithm
In this step MAC (Media Access Control) addresses of APs
in sorted vectors from online phase are compared to MAC
addresses stored in sorted vectors of AP in radio map database.
Based on comparison of MAC addresses ranks are assigned to
RSS Data
Radio map
Sort and
Rank Vector
MAC address
comparison
Rank vector
comparison
Estimate
position
vectors in database. When MAC addresses in online and offline
phases are the same, same rank values are assigned to them. In
this case rank of the AP does not need to represent position of
AP in vector. In case that one (or more) of the APs from the
online phase is not found in the database, the rank vector
created from the radio map is padded with 0, to achieve the
same length as the rank vector from the online phase.
Example of script used to create rank vectors in RBF
algorithm:
Ma=sort(RSS_AP)
Ra=1:size(Ma,2)
for k=1:n
for i=1:size(Ma,2)
for j=1:size(Mb(k))
if Ma(i)==Mb(k,j)
Rb(k,j)=Ra(i);
end
end
end
end
Where RSS_AP represents measurements from online phase
matrix created from RSS values and associated MAC addresses
of APs, size(Ma,2) represents number of APs in radio range, n
stands for number of the reference points in radio map
database, Ma and Mb(k) represents a vector of sorted MAC
addresses from online and offline phases respectively, Ra and
Rb(k) represents ranked vectors from online and offline phases
respectively.
In last step of RBF algorithm computed rank vectors are
compared to the vector from online phase using one of the
similarity measures introduced in the next section. The K
reference points with smallest difference are used to calculate
the estimated position x using the weighted average formula
(3). In proposed algorithm weights are given by similarity
between rank vectors from online and offline phase.
IV. SIMILARITY MEASURES
In this section similarity measures used to compare ranking
vectors in RBF algorithm are introduced. In all cases the online
and offline RSS vectors are assumed to have the same length.
A. Spearman distance
Spearman distance [15] is the square of Euclidean distance
between two rank vectors:
( )

=
=
n
k
k k S
y x D
1
2
, (4)
where x
k
is the rank of k-th element in vector X, y
k
is the rank of
k-th element in vector Y and n is the number of elements in
vectors X and Y.
B. Spearmans footrule
Spearmans footrule distance measures total element-wise
displacement between two ranked vectors [16]. It is similar to
the Manhattan distance for quantitative variables. Spearmans
footrule distance can be computed as:

=
=
n
k
k k F
y x D
1
. (5)
C. Jaccard coefficient
The Jaccard coefficient is used to measure the similarity of
two sets of data. It is defined as the size (cardinality) of the
intersection of the data sets divided by the size of the data sets
[17]. It is a special case of the normalized Hamming distance
and can be computed using:

| |
n
y x
C
n
k
k k
J

=
=
=
1
. (6)
D. Hamming distance
Hamming distance is the number of disagreements between
two vectors. Hamming distance can also be used for ordinal
variables to measure disorder of elements in two vectors [18].
In the RBF algorithm a weighted Hamming distance was used
to compute distance between two rank vectors:
| |

=
= =
n
k
k k k H
y x D
1
e , (7)
where
k
denotes the weight assigned to the k-th element of the
rank vector.
E. Canberra distance
The Canberra distance is the sum of fraction differences
between two vectors. Each fraction difference is a value
between 0 and 1 [19]. If one of used vector elements is zero,
the term become unity regardless the other values, thus the
distance will not be affected. A weighted version of Canberra
distance was used in the RBF algorithm:

k
n
k k k
k k
C
y x
y x
D e

=

+

=
1
. (8)
V. EXPERIMENTAL RESULTS
The experiment was carried out in Tietotalo building at
Tampere University of Technology. The area was covered with
96 reference points. The average number of heard APs per
fingerprint was 29 and altogether 206 APs were detected
during data collection.

Figure 2. Localization area
Measurements in the offline phase of the fingerprinting
algorithm were done with Nokia N900 mobile phone and the
data collecting software was implemented with Qt Developer.
At each point 30 measurements of RSSI values from APs in
range were done to partially eliminate fading effect. Mean
values of RSSI were then computed using:

=
=
S
N
i
i
s
RSSI
N
RSSI
1
1
______
, (9)
where N
s
is number of samples and RSSI
i
is i-th measured RSSI
value from the AP. The area where the test was performed,
with the positions of reference points, is shown in Fig. 2.
Experimental measurements in the online phase were done
a month later with the same mobile phone Nokia N900 and
then a couple of weeks later with an Asus N63 laptop using
WirelessMon software. When Nokia N900 was used 30
measurements at each point were done and in case that Asus
N63 was used 20 measurements were done at each point of the
track. Mean RSSI values were computed using (9).
Measured RSS data were used to estimate the position of
the mobile device using fingerprinting algorithms.
Measurements were done at 43 points, which do not refer to
reference points. Track of mobile devices in online phase is
shown on Fig. 2 as a black line.
1 2 3 4 5 6
0
2
4
6
8
Number of used reference points - k
M
e
d
i
a
n

e
r
r
o
r

[
m
]


Nokia N900
Asus N63

Figure 3. Impact of number of used RP on accuracy of RBF
Nokia N900 Asus N63
0
5
10
15
20
25
E
r
r
o
r

[
m
]
Spearman distance
Spearman's footrule
Hamming distance
Jaccard coefficient
Canberra distance

Figure 4. Bars show mean error achieved using RBF and error bars show the
5% and 95% quantiles Asterix show median error.
In this scenario differences in localization accuracy are
caused by the change of device used in the online phase and
also by changes in environment. In weighted similarity
measures decreasing weights were used, because it is assumed
that smaller RSSI values are more affected by fluctuations and
so it is more probable that rank of APs will be changed.
First impact of number of used reference points on location
estimation was investigated. From results shown in Fig. 3 can
be seen that number of used RP has impact on localization
accuracy.
It can be seen that median error is the smallest, when k=3
for both devices. That is the reason, why same value was used
in next experiments. It is also clear that localization error grows
from this number. This parameter of RBF algorithm depends
also on radio map properties. Radio map used in experiments
has relatively small density so when higher k is used, reference
points relatively far from real position will be used to estimate
position. It is assumed that when density of reference points in
radio map is higher, higher values of k will produce better
accuracy.
Results achieved in this scenario using proposed RBF
algorithm with different similarity measures are shown in Fig.
4. From results shown in Fig. 4 it can be seen that Spearmans
footrule performs best in this real world scenario. When
Spearmans footrule was used, median error does not change,
and mean error decreased by 1.5 meter when different devices
were used in online and offline phases. It is interesting to see
that Asus does better than Nokia, even though the Nokia was
used to create the radio map. This may be caused by changes of
the environment and also by hardware and software equipment
of used devices.
When best similarity measure in RBF algorithm was found,
performance of this algorithm can be compared to NN and
WKNN algorithms. These two algorithms were chosen because
the same formula (3) is used to estimate position of mobile
node, so impact of preprocessing used by RBF can be clearly
seen. For this comparison the same data were used; in NN and
WKNN algorithms the distance between RSS vectors and
weights were calculated using Euclidean distance. In WKNN
algorithm k=4 was used and weights were computed as
inverted value of Euclidian distance between vector from
online phase and vectors stored in radio map database.
Nokia N900 Asus N63
0
10
20
30
40
E
r
r
o
r

[
m
]
RBF
WKNN
NN

Figure 5. Comparison of RBF with NN and WKNN
From results shown in Fig. 5 it can be seen that mean error
of proposed RBF algorithm outperforms commonly used NN
and WKNN algorithms. It is clear that position error is less
affected by change of the mobile device and environment.
From these results RBF algorithm seems to be a great
improvement, compared to NN and WKNN algorithms.
Compared to WKNN, the mean error (bars on Fig. 5.) of
RBF algorithm is 50% lower when the same device was used
and 65% lower in case the devices in online and offline phases
were different. Note that RBF performs better than NN and
WKNN with every implemented similarity measure.
In Table I the maximum errors achieved in this scenario are
shown. It can be seen that RBF algorithm achieved the smallest
error when Asus N63 was used in online phase. In the other
hand, when Nokia N900 was used the smallest maximum error
was achieved by WKNN algorithm, but it is important to note
that data collected with Nokia were measured in different
conditions and this value represents only one big outlier for
RBF algorithm. It can also be seen, that when device was
changed maximum error grows only in combination with NN
and WKNN algorithms.
In previous scenarios, number of samples measured during
online phase was set to 30. Since this fact can lead to the delay
in position estimation Scenario III was performed to find
relation between number of measurement and localization
accuracy. Number of measurement during online phase of
fingerprinting algorithm was changed from 1 to 30. Achieved
results can be seen in Fig. 6. All measurements in this scenario
were done using an Asus N63.
TABLE I.
VALUES OF MAXIMUM ERRORS FROM SCENARIO II
RBF NN WKNN
Nokia N900 28.44 47.42 25.82
Asus N63 11.77 49.03 35.29

5 10 15 20 25 30
4
6
8
10
12
14
16
18
Number of measurements
M
e
d
i
a
n

l
o
c
a
l
i
z
a
t
i
o
n

e
r
r
o
r

[
m
]


RBF
WKNN
NN

Figure 6. Iimpact of the number of measurement on localization accuracy
From these results it is clear that proposed RBF algorithm
achieved best results in all cases and provides the most stable
positioning information. Interesting is fact, that accuracy of NN
and WKNN algorithms decreased with higher number of
measurements. Fluctuations, which can be seen in left part of
Fig. 6 are caused by signal fluctuations, which are not
eliminated because small number of measurements were
performed. So it can be assumed, that with different subset of
measurements completely different results can be achieved
especially when NN and WKNN algorithms are used. RBF
algorithm should not be affected as much as commonly used
NN algorithms. It can be seen, that with higher number of
measurements median error achieved by RBF algorithm is
smaller.
In Table II the maximum and minimum errors achieved in
Scenario III are shown. From results it is clear that RBF
algorithm achieved most stable and smallest errors, except of
case when just one measurement was done during online phase.
In that case WKNN algorithm achieved slightly better
maximum error value, but it is important to notice, that even in
this case RBF algorithm achieved better minimum (and also
median) error value.
It can also be seen that minimum and maximum error
values of RBF algorithm seems to be not affected by change of
number of measurements during online phase. In the other
hand NN and WKNN algorithms were affected and achieved
higher minimum and also maximum errors when higher
number of measurements was performed during online phase
of localization. NN and WKNN algorithms achieved stable
results when more than 8 measurements were performed during
online phase.
TABLE II.
VALUES OF MINIMUM AND MAXIMUM ERRORS FROM SCENARIO III
Number of
measurements
1 4 6 8 10 30
Min 0.09 0.75 0.75 0.75 0.75 0.09
RBF
Max 21.59 16.07 16.07 16.07 16.07 16.07
Min 1.82 0.68 1.35 2.48 2.35 1.86
WKNN
Max 20.18 18.98 35.50 36.95 33.01 35.29
Min 1.34 1.60 2.65 2.65 2.65 2.39
NN
Max 32.10 45.99 45.99 48.47 48.47 49.03
VI. CONCLUSION AND FUTURE WORK
We have described a novel RBF algorithm for indoor
localization. The main advantage of this algorithm is that its
performance is about the same for any receiver, without the
need of calibration of RSS values. Experimental results show
that proposed algorithm achieves better accuracy than
algorithms NN and WKNN.
The impact of different similarity measures used in RBF
algorithm was investigated. Spearmans footrule seems to
perform best among all implemented measures in a real indoor
environment. RBF in combination with any of the described
similarity measures performs better than NN and WKNN
algorithms.
Also impact of number of measurements during the online
phase of algorithm was evaluated. From results it is clear that
algorithms are affected by number of performed measurements.
RBF algorithm performs best in all cases and it seems to be
affected less than WKNN and KNN algorithm. Maximum and
minimum errors achieved by RBF algorithm was almost the
same for all cases.
In future more experimental tests will be done, and the
impact of AP placement, the number of APs and an impact of
moving people on localization accuracy will be investigated.
The impact of density of reference points used in offline phase
of algorithm to accuracy of proposed algorithm will be another
part of future research. Other similarity measures, such as in
Webber et al. [20], will also be studied.
ACKNOWLEDGMENT
This work was partially supported by the Slovak Research
and Development Agency under contract No. LPP-0126-09
and by the Slovak VEGA grant agency, Project No. 1/0392/10.
We thank Laura Wirola, ne Koski, and Toni Fadjukoff for
assistance in the data collection.
REFERENCES
[1] D. Mohapatra, S. B. Suma, Survey of location based wireless services,
IEEE International Conference on Personal Wireless Communications,
ICPWC 2005, 2005
[2] S. S. Chawathe,. Low-latency indoor localization using bluetooth
beacons, 12th International IEEE Conference on Intelligent
Transportation Systems, 2009. ITSC '09., pp: 1 7, 2009
[3] L. Zheng, W. Dehaene, G. Gielen, A 3-Tier UWB-based indoor
localization scheme for ultra-low-powersensor nodes, IEEE
International Conference on Signal Processing and Communications
ICSPC 2007, pp: 995-998, 2007
[4] L. Koski, T. Perl, R. Pich, Indoor positioning using WLAN
coverage area estimates, 2010 International Conference on Indoor
Positioning and Indoor Navigation IPIN2010, Sept. 2010
[5] O. Krejcar, User localization for large artifacts prebuffering and safety
possibilities in mobile embedded systems, International Conference on
Advanced Computer Control, January 2009

[6] V. Honkavirta, T. Perl, S. Ali-Lytty, R. Pich, A comparative
survey of WLAN location fingerprinting methods, 6th Workshop on
Positioning, Navigation and Communication, WPNC 2009, pp: 243
251, 2009
[7] B. Li, J. Salter, A. G. Dempster, C. Rizos, Indoor positioning
techniques based on wireless LAN, School of Surveying and Spatial
Information Systems, UNSW, Sydney, Australia, Tech. Rep., 2006.
[8] S. Saha, K. Chauhuri, D. Sanghi, P. Bhagwat, Location determination
of a mobile device using IEEE 802.11b access point signals, Wireless
Communications and Networking, WCNC 2003. vol. 3, pp: 1987 - 1992,
2003
[9] T. Vaupel; J. Seitz, F. Kiefer, S. Haimerl, J. Thielecke, Wi-Fi
positioning: System considerations and device calibration, International
Conference on Indoor Positioning and Indoor Navigation, IPIN2010,
Sept. 2010
[10] K. Yedavalli, B. Krishnamachari, S. Ravulat, B. Srinivasan,
Ecolocation: a sequence based technique for RF localization in wireless
sensor networks, Proceedings of the 4th International Symposium on
Information Processing in Sensor Networks, IPSN '05, pp. 285292,
April 2005.
[11] D. Chen; W. Xiao; X. Zhao; An improved localization algorithm in
wireless sensor network, IEEE International Conference on Robotics
and Biomimetics ROBIO 2009, pp.1253-1258, Dec. 2009
[12] Z. Liu; J. Chen, A New Sequence-Based Iterative Localization in
Wireless Sensor Networks, International Conference on Information
Engineering and Computer Science ICIECS 2009., pp.1-4, Dec. 2009
[13] Tsung-Nan Lin; Po-Chiang Lin, Performance comparison of indoor
positioning techniques based on location fingerprinting in wireless
networks, International Conference Wireless Networks,
Communications and Mobile Computing 2005, Volume 2, pp. 1569-
1574, 2005
[14] J. Machaj, P. Brida, Performance Comparison of Similarity
Measurements for Database Correlation Localization Method, 3rd
Asian Conference on Intelligent Information and Database Systems
ACIIDS 2011, Daegu, South Korea, ser. Lecture Notes in Computer
Science, Springer Berlin / Heidelberg, vol. 6592, ch. 46, pp. 452-461,
ISBN 978-3-642-20041-0. April 2011.
[15] I. Contreras, Emphasizing the rank positions in a distance-based
aggregation procedure, Decision Support Systems, Volume 51, Issue 1,
pp. 240-245 April 2011
[16] R. Kumar, S. Vassilvitskii, Generalized distances between rankings,
Proceedings of the 19th international conference on World wide web,
April 2010
[17] J. Bank, B. Cole, Calculating the Jaccard Similarity Coefficient with
Map Reduce for Entity Pairs in Wikipedia,, Wikipedia Similarity
Team, December 2008
[18] A. Tarsitano, Comparing the effectiveness of rank correlation
statistics, Working Papers, Universit della Calabria, Dipartimento di
Economia e Statistica, 2009.
[19] S.-H. Cha, Comprehensive survey on distance/similarity measures
between probability density functions, International Journal of
Mathematical Models and Methods in Applied Science, vol. 1, no. 4,
2007
[20] W. Webber, A. Moffat, J. Zobel, A similarity measure for indefinite
rankings, ACM Transactions on Information Systems, Volume 28,
Issue 4, 38 pages, November 2010

You might also like