Monday 28 January 2019

[Tutorial] WiFi Indoor Fingerprinting Positioning

Objectives



  • Look through the content to build an overview of WiFi indoor positioning.
  • Following the WiFi fingerprinting positioning experimental guideline to learn how to design the experiment, how to collect data and how to process data using our source codes.
  • Do a mini WiFi fingerprinting positioning experiment in the lab room. 
  • Try to understand the code and think about any improvement you can make

Introduction

What is WiFi indoor fingerprinting positioning technique? Why we need it?
As both indoor and outdoor spaces become more complex, especially in urban areas, the need for indoor positioning and navigation services becomes paramount. There are many other value-add location-based services (LBS) applications, e.g., commercial ads, can be made more personalized if they are location-aware. Due to the increasing complexity of the indoor environment and the lack of a global positioning system, the research and development for low cost, high accuracy, real-time and high reliable LBS is still full of challenges.

An indoor positioning system (IPS) is a system to locate objects or people inside a building using Radio Frequency (RF), magnetic fields, acoustic signals and dead-reckoning approaches using inertial sensors such as accelerometers and gyroscopes integrated into mobile devices.  Although a range of indoor localization technologies can be used, the use of Wireless Fidelity (WiFi) as a positioning system has become more popular in recent years, especially indoors, because of the broad deployment of APs. 

There are mainly two different methods of WiFi positioning, WiFi fingerprinting vs. WiFi trilateration as shown below.
Fig. 1 The Overview of WiFi Fingerprinting
Fig. 2 The Overview of WiFi Trilateration
The main idea of the WiFi trilateration method is based on the use of the status (travel time, angle, Received Signal Strength Indicator) of the signal sending or receiving to compute the distance list between access points (APs) and a mobile end to determine the location. In order to obtain accurate travel time and angle, special equipment is often necessary. Besides, for RSSI-based trilateration scheme which uses signal decay (or signal attenuation or path loss) model to fit the signal change with distance, it is easily affected by environments leading to great fluctuation in the distance calculation since the signal decay model assumes a free space for RF signal propagation but almost all physical space is not free it contains physical objects such as people and fixtures, which causes additional complex RF signal attenuation and reflection so reducing its accuracy. 

In comparison, the fingerprint-based technique offers a more accurate positioning system in comparison. It typically works in two phases. Firstly, it requires a fingerprint or radio map of RF signals to be collected in an offline phase where the RSSI signals from multiple APs are collected and mapped to locations determined by some other more accurate location determination method, e.g., laser tape, UWB, and then stored as a radio map or fingerprint database. Then during a second, operational or online phase, the location is determined through an estimation of matching the current position with the nearest known location in the pre-stored radio map. Then let's look closer to the WiFi fingerprinting method.

The process of WiFi Indoor Fingerprinting Positioning

Here I give you a flow of WiFi fingerprinting method as shown in fig. 3 (a), in which two stages are divided. Thus, I will show you the details of both stages by this rule. 
Fig. 3 The Flow of WiFi Fingerprinting

Fig. 4 The details of a fingerprint database

1. Site Survey (Offline) 

The general way we use to divide the indoor space before establishing the indoor fingerprint database (map) is to grid the indoor space on the plane. Just as shown in fig. 3 (b), the black rectangle stands for the indoor space plane. We can set many positions (blue points) evenly to split this space. These blue points are so-called reference points (RPs). The locations of these RPs need to be determined manually, e.g using measuring taping or other positioning schemes with high accuracy.

2.Building Fingerprint Database (Offline)

The aim of the site survey is to split an indoor plane and get the true locations of RPs. Then we can embark on the fingerprint map establishment. The processes are: firstly, putting a mobile end at each RP to collect RSSI measurements from detectable APs, the height of the mobile end keeps the same level as much as possible (to control environmental factors to increase accuracy). Secondly, the collection time at each point should be long enough to get stable RSSI readings, e.g. 1-2 minutes. Thirdly, after finishing the data collection, matching the coordinates (X, Y for 2D plane; X, Y, Z for 3D plane) with RSSI measurements respectively and constituting the fingerprint map. 
Tips: the details of a fingerprint database are shown in the fig. 4. L means the coordinates. And RSSIi means the RSSI measurements from different APs.

3.Online Signal measurement

Step 1 and 2 belong to the offline stage for creating the radio map (fingerprint database), the online positioning is a process of matching by using the RSSI measurements at an unknown location to compare against the RSSI at those RPs to find the closest RP, and take this RP's location as the approximate location of this unknown point. Therefore, online signal measurement is necessary to localization. The details of signal measurement are shown in the fig.4 (lower part).

4.Localization Algorithm (online)

Localization Algorithm is the core of the WiFi fingerprinting scheme. From the aforesaid matching process, the location problem can be viewed as a pattern matching problem which runs by a chain including data collection, data preprocessing, feature extraction, feature selection and matching algorithms. The data collection in WiFi fingerprint includes establishing the radio map on the offline stage and signal measurement on the online stage. About the data preprocessing, the general processes include discarding outlines, missing values processing, signal filtering and so on. The term feature in pattern matching stands for any kind of information which can be used to recognize or classify different objects. Here, the feature is the RSSI collection from multi-APs. The size of features probably affects the computation efficiency and matching accuracy. So, we need an operation of feature extraction. Matching is the last step. So the chain for a matching problem is:
  1. data collection
  2. preprocessing
  3. feature extraction (e,g, AP selection)
  4. matching or classification algorithm
  5. evaluation metrics
Here, an overview of pattern matching is shown to you. Taking this,  we are going to touch the details of data processing using one example from my paper published on WTS2018.

Real Data Processing

After the introduction above, you may get a rough idea about WiFi fingerprinting positioning technique. Now we provide some experimental data as well as the processing codes on python for you to do practice.  
  • 1. Data Collection App
This data collection app is created by our Lab, which is based on the Android platform. Once launching the app, selecting the function [Sensors] on the navigation menu at the upper-left corner of the screen. Then you will find the [WiFi] menu and click it to enter into the WiFi RSSI collector.
  • 2. Offline Site Survey 
Fig. 5 the overview of a site map
The blue points are reference points red points are test points. 
There are 112 Reference Points (RPs) evenly distributed in this room which are 1m apart. The Test Points (TPs) along these predefined paths are 0.5 m apart. 
The RSSI samples of RPs and TPs are collected using the same mobile device. At the offline stage, the size of RSSI samples at each RP is about 120. There are 105 detectable APs in all. At the online stage, the sample size is 5 at each TP. More information about this experiment refers to my paper
The observation files are included in the SourceCode: >>>
There are four sub-directories in the data directory.
  • Reference_Points_Coordinates
  • Reference_Points_RSSI
  • Test_Points_Coordinates
  • Test_Points_RSSI
As the setting of this data directory is designed for my source codes in Python. you can follow this way to process your data.
  • 3. Data input
In the WiFiFingerprintinglocalization2.py, we integrated classes and interfaces for you. The class Fingerprint() is to read data (RSSI, coordinates) from the data directory. The interface for this class is in the form:

trainRSSI, testRSSI, trainCoor, testCoor = Fingerprint(trainDataFilePath = 'data', missingValue = -100).readData()


trainDataFilePath is the path for data directory in your computer.  
  • 4. Feature Extraction (AP selection)
In our experiment, there are totally 105 APs, each AP is viewed as a feature to distinguish current location (e.g. TPs) to other locations (e.g. RPs). AP selection is not only to increase the computation efficiency but also good to lift the positioning performance. Here, I listed three selection methods based on statistic values of RSSI, including maxMean(),  standardDeviation() and intervalOverlapDegree(). More details about these methods, please refer my paper >>>.
The use style of these methods are:

newRPObs, newTPObs = APSelection(trainRSSI, testRSSI, ApCount=70, model = 'IOD').execution() 

ApCount is the number of APs you want to select.
model is the parameter of selection models.
  • 5. localization determination algorithms: KNN
KNN is a common-used method for classification problem. The reason we use KNN is that instead of just using the coordinate from one RP matched, using the (weighted) average coordinates from k nearset RPs has a better positioning performance.  
K is an empiracal value, you can test the best K for your data.
The use style of these methods are:


resul, metrics = knn_positioning(newRPObs, newTPObs, trainCoor,testCoor, k=4, model = 'mean')
stands for the value of K in KNN;
model is to choose whether we take each observation as an example or take the mean of all observations during collection time as an example. 
metrics is about the evaluation metrics.

Conclusion

This short tutorial report is mainly to show you an overview of the WiFi fingerprint positioning technique. The fingerprint-based method is treated as a problem of pattern recognition. If you have some related backgrounds about pattern recognition, you will be easier to understand.
Apart from this principle, I also gave you an Android app to collect WiFi, a python source code to process the data. The classes and interfaces designed in that py file can be further accomplished based on your data features.    
Please refer our papers if you use our experimental data for research.

References

Radius-based domain clustering for WiFi indoor positioning. W Zhang, X Hua, K Yu, W Qiu, X Chang, B Wu, X Chen - Sensor Review, 2017.

An efficient wireless access point selection algorithm for location determination based on RSSI interval overlap degree determination. B Wu, Z Ma, S Poslad, W Zhang - Wireless Telecommunications Symposium (WTS) …, 2018.

WiFi Fingerprint Based, Indoor, Location-Driven Activities of Daily Living Recognition. Bang Wu, Zixiang Ma, Stefan Poslad, Yidong Li. BESC2018

SourceCode: >>>


No comments:

Post a Comment

[Research] Recurrent Neural Network (RNN)

1. Introduction As we all know, forward neural networks (FNN) have no connection between neurons in the same layer or in cross layers. Th...