Download - Fingerprinting-based Indoor Positioning
Fingerprinting-based Indoor Positioning
Dr. R. Montoliu, Dr J. Torres-Sospedra, Dr. A. Pérez-Navarro, Dr. J. Conesa, Dr. O. Belmonte
The main objective of this tutorial is:
● The students will learn how to develop a fingerprint-based localization algorithm from zero avoiding the same mistakes we faced when we started.
Professors:Dr. R. Montoliu
Dr. J. Torres-Sospedra
Dr. A. Pérez-Navarro
Dr. J. Conesa
Dr. O. Belmonte
Phd student G. Mendoza
Table of contentsPart Time Content
1 17:00-17:15 Introduction to fingerprinting
2 17:15-17:30 Theoretical background
3 17:30-17:45 The training step
4 17:45-18:15 Time to perform the training step
5 18:15-18:30 The operational step
6 18:30-18:45 Time to play with operational source code
7 18:45-19:00 How to improve the ILS
8 19:00-19:15 Time to improve the ILS
9 19:15-19:30 Awards
Introduction to fingerprinting● Four types of indoor localization algorithms:
○ Deploy beacons○ Use existing beacons and the position of the beacons is known○ Use existing beacons and the position of the beacons is unknown○ No use beacons
1. Deploy beacons
https://www.kinvey.com/wp-content/uploads/2014/05/beacon.jpg
1. Deploy beacons
http://www.clipartkid.com/images/679/pedestrian-20clipart-clipart-panda-free-clipart-images-gz3PIn-clipart.png
1. Deploy beacons
● The position of the beacons is known○ Trilateration techniques can be applied
● High accuracy can be obtained
https://pixabay.com/static/uploads/photo/2013/07/13/13/24/fist-160957_640.png https://pixabay.com/static/uploads/photo/2013/07/13/13/24/fist-160958_640.png
● Expensive● A lot of beacons can be needed in big scenarios
2. Use existing beacons (knowing the position)
● Apply trilateration
Note that the existing beacons could be deployed for providing
some services, but not localization.
2. Use existing beacons (knowing the position)
● The position of the beacons is known○ Trilateration techniques can be applied
● High accuracy can be obtained● Cheap, since we are using already deployed devices
● High dependence of the existing beacons○ Most of the times, without localization purpose
● Low accuracy if there are a few number of beacons
3. Use existing beacons without knowing the position
● Cheap, since we are using already deployed devices
● High dependence of the existing beacons● Low accuracy if there are a few number of beacons● Less accuracy than previous cases● The position of the beacons is unknown
○ Trilateration techniques can not be applied
4. Without using beacons
● Magnetic field disturbances are constant● No devices are needed● The cheapest solution
● Less discriminative power than WIFI fingerprinting● Not easy solution
○ Algorithms are in “work in progress” state
A brief introduction to Fingerprinting based methods● Two main steps:
○ Training step○ Operational step
● Beacons are WIFI AP○ Position is unknown
The training step
MAC RSII
xx-xx-xx-xx-xx-xx -30db
... -80db
xx-xx-xx-xx-xx-xx -45db
Latitude Longitude
The training step
MAC RSII
xx-xx-xx-xx-xx-xx -30db
... -80db
xx-xx-xx-xx-xx-xx -45db
Latitude Longitude
MAC RSII
xx-xx-xx-xx-xx-xx -80db
... -30db
xx-xx-xx-xx-xx-xx -95db
Latitude Longitude
The training step● UJIIndorloc database:
○ https://archive.ics.uci.edu/ml/datasets/UJIIndoorLoc
● Some data:○ 21048 fingerprints○ 520 different MACs○ 4 multifloor building
● Platform to share results
The training step● UJIIndorloc database:
○ Joaquín Torres-Sospedra, Raúl Montoliu, Adolfo Martínez-Usó, Tomar J. Arnau, Joan P.
Avariento, Mauri Benedito-Bordonau, Joaquín Huerta “UJIIndoorLoc: A New Multi-building and
Multi-floor Database for WLAN Fingerprint-based Indoor Localization Problems” In
Proceedings of the Fifth International Conference on Indoor Positioning and Indoor Navigation, 2014.
MAC001 MAC002 ... MAC520 Longitude Latitude Floor Building User Phone Timestamp
The operational step
Training Fingerprintsdatabase
Indoor Localization
System
MAC RSII
xx-xx-xx-xx-xx-xx -30db
... -80db
xx-xx-xx-xx-xx-xx -45db
The operational step● A kNN based algorithm is used to obtain the localization
● It will be explained after in this tutorial
Discrete vs continuous positioning● This tutorial only cover discrete localization
○ The system only use the information captured in a particular time moment to estimate the location.
● Continuos positioning:○ The system use the last information captured and some historic data.○ Tracking.
Waves● Wifi are electromagnetic waves and behave like them● They are affected by the following phenomena:
○ Reflection○ Refraction○ Diffraction○ Absorption
Electromagnetic Spectrum
Per Inductiveload, NASA [GFDL (http://www.gnu.org/copyleft/fdl.html) o CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0/)], via la Wikimedia Commons
Electromagnetic Spectrum
Per Inductiveload, NASA [GFDL (http://www.gnu.org/copyleft/fdl.html) o CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0/)], via la Wikimedia Commons
Electromagnetic Spectrum
Per Inductiveload, NASA [GFDL (http://www.gnu.org/copyleft/fdl.html) o CC-BY-SA-3.0 (http://creativecommons.org/licenses/by-sa/3.0/)], via la Wikimedia Commons
WiFi:2,4 GHz5 GHz
Difraction
Per Bbkkk (Treball propi) [GFDL (http://www.gnu.org/copyleft/fdl.html) o CC BY-SA 4.0-3.0-2.5-2.0-1.0 (http://creativecommons.org/licenses/by-sa/4.0-3.0-2.5-2.0-1.0)], via la Wikimedia Commons
AbsorptionIntensity
Attenuation coefficient
Penetration depth
frequency
magnetic permeability
conductivity
Bodies absorb WiFi radiation
Specific Absorption Rate (SAR)Power absorved
mass
Also exists the Whole Body SAR (WBSAR)
Absorption cross section
Absorption Cross Section Power absorved
Power density in the incident wave
Silhouette area of a perfectly-absorbing surface thatwould absorb the same power as the loading object under discussion
Dependence on tissue
Source: S. Gabriel, R. W. Lau, and C. Gabriel, “The dielectric properties of biological tissues:III. parametric models for the dielectric spectrum of tissues,” Physics in Medicine andBiology, vol. 41, no. 11, p. 2271, 1996.
Frequency of 1 cm penetration
Dry Skin 5.2 GHz
Infiltrated Fat 9.5 GHz
Muscle 4.7 GHz
Source: Melia, Gregory (2013) Electromagnetic Absorption by the Human Body from 1 - 15 GHz. PhD thesis, University of York.
Dependence on position
Source: Melia, Gregory (2013) Electromagnetic Absorption by the Human Body from 1 - 15 GHz. PhD thesis, University of York.
Dependence on clothes
Source: Melia, Gregory (2013) Electromagnetic Absorption by the Human Body from 1 - 15 GHz. PhD thesis, University of York.
Results
Source: Melia, Gregory (2013) Electromagnetic Absorption by the Human Body from 1 - 15 GHz. PhD thesis, University of York.
All body mean approximation
Source: S. Garcia-Villalonga and A. Perez-Navarro, "Influence of human absorption of Wi-Fi signal in indoor positioning with Wi-Fi fingerprinting," Indoor Positioning and Indoor Navigation (IPIN), 2015 International Conference on, Banff, AB, 2015, pp. 1-10.doi: 10.1109/IPIN.2015.7346778
Example
● 83 points● 8.23 m of distance
between them● Few-bodies time (9 AM)
● 115 points● 42 inside shops● 73 in corridors● 5.56 m of minimum distance
RadioMap
Test
Summary● WiFi is an electromagnetic wave: microwaves.● It is affected by:
○ Reflection○ Refraction○ Absorption○ Diffraction
Changes in the environment can affect values of WiFi measured
● Life tissues absorb microwaves.● Different tissues have different absorptions
Changes in the number of people affect values of WiFi measured
● Different frequencies are affected in different ways.
Reference Data
Strong, Medium, Medium, Medium, Weak
Medium, Strong, Strong, Medium, Medium
Weak, Medium, Medium, Strong, Medium
Weak, Weak, Medium, Medium, Strong
Reference Data
Medium, Strong, Strong, Medium, Medium
Medium, Strong, Strong, Medium, N/A
Medium, Strong, Medium, Medium, Medium
Strong, Strong, Strong, Medium, Medium
Reference Data
https://pixabay.com/es/persona-icono-salida-de-emergencia-1332793/
Medium, Strong, Strong, Medium, N/A
Reference Data
Medium, Strong, Strong, Medium, Medium
Medium, Strong, Strong, Medium, Medium
Medium, Strong, Strong, Medium, Medium
Medium, Strong, Strong, Medium, Medium
Reference Data
https://commons.wikimedia.org/wiki/File:Mobile_phone_font_awesome.svghttps://www.goodfreephotos.com/vector-images/mobile-cellphone-vector-clipart.png.php
https://pixabay.com/es/smartphone-tel%C3%A9fono-m%C3%B3vil-tel%C3%A9fono-1132675/https://commons.wikimedia.org/wiki/File:Mobile_phone.svg
Medium, Strong, Strong, Medium, Medium
Medium, Medium, Strong, Medium, Medium
Medium, Strong, Strong, Medium, Medium-Weak
Medium-Weak, Strong, Strong, Medium, Medium
Strong ~ -40dBm
Strong ~ -50dBm
Strong ~ -30dBm
Strong ~ -35dBm
https://i.ytimg.com/vi/OyRW9uFSmh0/maxresdefault.jpg
Reference Data
Strong, Medium, Medium, Medium, Weak
Medium, Strong, Strong, Medium, Medium
Weak, Medium, Medium, Strong, Medium
Weak, Weak, Medium, Medium, Strong
Reference Data
https://pixabay.com/p-303768/?no_redirect
Cover all the environmentConsider spatial densityConsider temporal densityConsider device heterogeneityConsider dynamics of the environment
Reference Data
Now I have the training data...
I have a perfect
Indoor Location System
https://c2.staticflickr.com/4/3228/2373073659_d231a0cc65.jpg
Reference Data
You need independent data to fine tune and validate your systemhttp://www.relatably.com/m/img/valid-memes/78c0b38fecebd3c736c8123b34fc69059aedce91ada224ee82677ba7707e14f9.jpg
Validation data
Avoid using Training Data!
It may provide slanted information.N consecutive fps: (N-1) Training and 1 for validation ? No!
Validation DataNecessary to:
1. Provide an estimation of the IPSs error: geometric error, hit detection rates,...2. Calibrate your System: kNN algorithms and variants3. Filter APs4. Among many other useful operations :-)
Validation DataWhat happens if there is no Validation Data ?
1. k-fold Cross-Validation of training data
2. Consider groups of samples: ref point, user, device, day, among others to increase diversity and independence of the sets
~ 60-80% training, 40-20% validation
Validation Data
Now I have the validation data...
I have a perfect
Indoor Location System
https://c2.staticflickr.com/4/3228/2373073659_d231a0cc65.jpg
Operational Data vs. Testing Data
Depending on the main objective of the IPS, you may have
1. Operational DataFingerprints from working system + Feedback from users
2. Testing DataFingerprints explicitly collected for testing
Research: Training + Validation + TestBetter if Test Data is Blind
UJIIndoorLoc has T + V + Blind TS !!!
Mapping Strategies
Slow procedure!High precision in reference pointsHigh precision on the fingerprint measuresConsecutive / Cumulative valuesDense radio mapSimple
Mapping Strategies
Slow procedure!High precision in reference pointsHigh precision on the fingerprint measuresConsecutive / Cumulative valuesDense radio mapSimple
Mapping Strategies
Slow procedure!High precision in reference pointsHigh precision on the fingerprint measuresConsecutive / Cumulative valuesDense radio mapSimple
Mapping Strategies
Fast procedure!You have a few reference or calibration pointsDepends on user’s velocityFingerprint readings may be close or far to ref. pointsFingerprint attached to a segment of the pathThe reference point may be displaced to the real pathLight radio mapComplex
https://c1.staticflickr.com/9/8429/7755469546_61f6d51490_b.jpg
Storing Data
- Raw data- Database: mySQL, HADOOP, mongoDB,...
Record as maximum information as possible!
mac, rssi, channel, bssid, ....position (XYZ), room, area, floor, building, ...
Storing Data
- CSV Files + Document (UJIIndoorLoc)RSSI1 RSSI2 RSSI3 ... RSSIn X Y Z ... Others
-99 +100 -88 -55 0 0 0 ... 0
Use of default value for non-detected signal +100Use of a documented coordinate system XYZUse of additional location info: office, area, floor, building, campus, city, ….
https://cdn.meme.am/instances/500x/58606836.jpg
Part 4: Time to training
http://www.soulseeds.com/wp-content/uploads/2011/10/take-ownership.jpg
The kNN algorithmAlgorithm with k=1
● INPUT:○ Training database (samples and labels of each sample)○ Test sample
● OUTPUT:○ Label of the test sample
● BEGIN○ Estimate the distances between the test sample and all training ones○ Return the label of the training sample with less distance
● END
The kNN algorithmAlgorithm with k>1
● INPUT:○ Training database (samples and labels of each sample)○ Test sample
● OUTPUT:○ Label of the test sample
● BEGIN○ Estimate the distances between the test sample and all training ones○ Get the labels of the k-th training samples with less distance○ Return the majority label
● END
The kNN algorithm in indoor localization● In the classical classification problems, each sample has a label
● In indoor localization each sample (fingerprint) has two continuous values as label: longitude and latitude.
The kNN algorithm in indoor localization● With k=1
○ The localization of the test sample, is the localization of the closest sample in the training dataset.
■ “closest” in the feature space
The kNN algorithm in indoor localization● With k>1
○ The localization of the test sample, is the centroid of the localizations of the k-th closest samples in the training dataset.
The kNN algorithm in indoor localization● With k>1
○ The localization of the test sample, is the centroid of the localizations of the k-th closest samples in the training dataset.
Source code explanationfunction IPIN2016_Tutorial_TrainYourSystem conf = SetMyConfiguration(); data = ReadAllData(conf); data = ChangeDataRepresentation(data);
for i=1:conf.experiment_repetitions folds = DivideInFolds(number_of_samples,conf); vmean_error_in_meters(i) = KnnWithCrossValidation(data, folds, conf); end mean_error_in_meters = mean(vmean_error_in_meters); fprintf('\n The method has obtained an error of %f meters.\n',mean_error_in_meters);end
Source code explanationfunction mean_error_in_meters = KnnWithCrossValidation(data, folds, conf) M = conf.number_of_macs; for i=1:conf.number_of_folds for j=1:conf.number_of_folds if (i==j) test_data = data(folds{i},1:M); test_labels = data(folds{i},M+1:M+2); else train_data = [train_data; data(folds{j},1:M)]; train_labels = [train_labels; data(folds{j},M+1:M+2)]; end end est_labels = ApplyKnn(train_data,train_labels,test_data,conf); verror(i) = EstimateMeanErrorMeters(est_labels,test_labels); end mean_error_in_meters = mean(verror);end
Source code explanationfunction est_labels = ApplyKnn(train_data,train_labels,test_data,conf) distance_matrix = GetDistanceMatrix(train_data,test_data,conf); for i=1:N_test vpos = GetPositionsOfTheMinimums(distance_matrix,conf); lat = 0; long = 0; for j=1:conf.k lat = lat + train_labels(vpos(j),2); long = long + train_labels(vpos(j),1); end est_labels(i,:) = [ long/conf.k, lat/conf.k ]; endend
Competition rules (first phase)● Read SetMyConfiguration().
● Test with using different parameter configuration.
● Write in the competition paper the best solution.
Competition rules (first phase)
● You have only 20 minutes.
● If you do not hand the paper in time, your results will not be estimated.
How to improve the ILSPresence of Noisy WAPs
1. SSID ‘iPhone of …’2. Very weak signal3. Located at distant places4. High variability in the same reference point
FEATURE SELECTION
How to improve the ILSHuge workload of the kNN algorithm:
1. Simplify reference dataseta. Calculate meansb. Remove noisy fingerprints in ref. pointc. Remove repeated fingerprints
2. Apply clustering pre-stagea. Group similar fingerprints - Representative FP
3. Reduce reference dataset on-the-flya. Common macsb. Strongest signal
CONDENSE & FILTER
How to improve the ILS● Use knowledge on Signal Propagation to develop better distance metrics
10 dBm of difference in both casesVery different meaning!!!
-45 -80 X
-55 -80 X-55 -90 X
vs
How to improve the ILS● Use knowledge on Signal Propagation to develop better distance metrics
Perfect match in both cases The second case is less representative!
-50 -40 -60 -50 -40 -60
N/A -55 N/A N/A -55 N/A
vs
vs
How to improve the ILS● Use knowledge on Signal Propagation to develop better distance metrics
Continuityproblems!
-50 -45 -70
N/A -50 -70 N/A -45 N/Avs
-50 -45 N/A
-55 -45 -60
-50 -40 N/A
Competition rules (second phase)● You are allowed to modified the function:
○ ApplyKnn○ ChangeDataRepresentation
● But, you can not modified the function:○ TestKnn