You are on page 1of 8

Pervasive Positioning

Project 1 - WiFi Positioning


Kenneth Sejdenfaden Bgh, 20071353, u071354@cs.au.dk
Frederik Mogensen, 20080923, mogensen@cs.au.dk
Peter Urbak, 20081130, peteru@cs.au.dk
November 24, 2011

Contents
Contents

1 Introdution

2 Implementation
2.1 Fingerprinting-based Nearest Neighbor Search . . . . . . . . . .
2.2 Model-based Nearest Neighbor Search . . . . . . . . . . . . . .
2.3 Statistical Calculations . . . . . . . . . . . . . . . . . . . . . . .

3
3
4
4

3 Experiments
3.1 Signal Strength compared to Distance . . . . .
3.2 Error Distributions . . . . . . . . . . . . . . . .
3.3 Online Samples compared to Median Accuracy
3.4 Values of K compared to the Median Accuracy

4
4
5
5
6

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

.
.
.
.

4 Conclusion

Bibliography

Introdution

Introdution

In this report, we will present our Java-based WiFi Positioning project, which
focuses on the implementation and evaluation of nearest neighbor searches in
an indoor environment.
First, we will cover the implementations of fingerprinting-based and modelbased k-nearest neighbor search algorithms, and also discuss some of the
choices we had to make in order to optimize our algorithms.
After having covered the implementations, we will look at the experiments
we performed using our algorithms on the supplied test data.
Lastly, we will end our report with a conclusion, which wraps up our findings from testing our nearest neighbor searches.

Implementation

In this chapter, we will go through the implementations of our, fingerprintingand model-based, nearest neighbor searches for WiFi positioning, and discuss
some of the more interesting choices we had to make when implementing them.
We will also shortly cover the implementation of the small statistics program,
scoreNN, which generates an error distribution of the output from our nearest
neighbor programs.
We furthermore created the class Utility, which is in charge of the different distance calculations and also loads the access point data.

2.1

Fingerprinting-based Nearest Neighbor Search

We implemented the fingerprinting-based NN search by creating the class


FingerprintingNN which takes an optional argument k, in case we want our
result to contain more than one nearest neighbor, thus merging the two programs, fingerprintingNN and fingerprintingKNN, stated in the assignment
into one class.
We decided to address the issue of different sets of APs in the signal strength samples, by issuing a penalty of a fixed size, as sugggested
in [1], for each of the APs not found in the intersection of the two
SignalStrengthSamples. The actual penalty was the value 96dBm, based
on the weakest AP signal we could find for a offline point in our empirical
data. By doing so, we managed to improve our results significantly as opposed
to just ignoring the difference in AP sets.
We implemented the k variation of the nearest neighbor search by
simply putting each distance calculated into a TreeMap and then calling
DistanceMap.firstKey() k times.

2.2.

2.2

Model-based Nearest Neighbor Search

Model-based Nearest Neighbor Search

We used the same approach for implementing modelNN as we did in the fingerprinting case, i.e. we merged the two versions, NN and k-NN into one class,
ModelNN.
When we had to determine when a signal was unhearable, we used simple
trial and error to come up with a value would give us the best approximation
with our data set. We ended up using a value of 80dBm as this seemed to
give us the best results, even though it is a bit higher than the 96dBm which
was the value of the weakest signal detected in our empirical data set.
In the case, where an online point has none of our 11 APs of which we
know the position, we simply set the distance to the equal to NaN and make
a check for this value when computing our statistical data so it doesnt get
corrupted by the NaN.
Likewise, we chose to ignore all APs which are not part of our 11 known
APs, since we cant compute any distances if dont know their actual position.
Theoretically though, one could try to estimate the unknown APs from the
signal strengths of our offline points and see if this would give us better results.

2.3

Statistical Calculations

The scoreNN class first parses our results, from the previously mentioned
classes, by splitting each line into two GeoPosition objects, the actual position and the estimated, and then saving the real distance between them into
an array. We then calculate the average and standard deviation of the arrays
content, using the Statistics class provided by the framework, and use these
value for calculating the cumulative distribution function for each distance
value and printing it to a file.

Experiments

In this chapter we will look at the design of, and results from, the experiments
we have performed using the supplied test data as input to our implementations
of fingerprinting- and model-based WiFi Positioning.
In order to perform the hundred iterations of each experiment, we wrote
a number of shell scripts, which we distributed across a number of llama machines on the network of the Computer Science Department. All these results
are then merged and plotted using gnu plot via another script.

3.1

Signal Strength compared to Distance

Figure 1 illustrates the signal strength as a function of the distance. The relatively high fluctuation in signal strengths between points at similar distances

3.2.

Error Distributions

can be attributed to the layout of the rooms, location of the mobile user and
various obstructions as well as time of day, since people are more likely to be
at the office during the day.

Figure 1: Signal Strength compared to Distance.

3.2

Error Distributions

If we look at Figure 2, we notice a few things. First, the fingerprinting-based


data has a significantly smaller error distance compared to the model-based.
Furthermore, it is also noticed that the fingerprinting data which uses k = 3
has a slightly lower error distance than the single nearest neighbor version. It
is however surprising that the k = 3 nearest neighbor version of the model
based version is actually slightly worse than the simple version. This might be
due to the fact that we have fewer access point to work up against, but could
also be a result of the fact that we have not implemented the WAF.

3.3

Online Samples compared to Median Accuracy

For this(and the next graph) we were a bit in doubt of what data was expected,
but ended up concluding that it most likely was the median of each of the 100
runs, averaged. As such that is what we have computed and plotted.

3.4.

Values of K compared to the Median Accuracy

We observe, when looking at Figure 3, that our two model-based algorithms


do not gain any significant precision when using more online samples, while our
fingerprinting-based algorithms gain a rather significant increase in precision.

3.4

Values of K compared to the Median Accuracy

Once again, we see that the precision increases as k increases for the
fingerprinting-based algorithm while it actually decreases for the model-based
algorithm. The decrease in precision for the model-based algorithm, may be
due to the fact that we have very limited data for the APs in radio map, and
thus the average will actually skewer the result when we are forced to choose
k neighbors which might be quite far away.

Conclusion

After having implemented our Wifi Positioning nearest neighbor schemes, and
tested their precision when used on the predefined radio map data we were
given. We can conclude, as expected, that the fingerprinting-based algorithms
perform significantly better in terms of precision than the model-based algorithms, however it would have been possible to further optimize the modelbased scheme by taking into account the WAF (Wall Attentuation Factor).

Bibliography
[1] Krumm et al. Ubiquitous Computing. CRC Press, 2010.

Probability

Figure 2: Error Distribution for KNN where K = 3.

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

15
Error distance (meters)

10

20

Fingerprinting-KNN-3.online-5
Fingerprinting-NN.online-5
model-KNN-3.online-5
model-NN.online-5
25

Bibliography
7

Bibliography

Figure 3: Online Samples compared to Median Accuracy.

Figure 4: Values of K compared to Median Accuracy.

You might also like