# Location Fixing and Fingerprint Matching Fingerprint Map Construction for Indoor Localization

Authors: Marwan Alakhras; Mousa Hussein; Mourad Oussalah
Journal: Journal of Sensors
 (2020)

---

## Abstract

Building the fingerprint map for indoor localization problems is a labour-intensive and time-consuming process. However, due to its direct influence on the location estimation accuracy, finding a proper mechanism to construct the fingerprint map is essential to enhance the position estimation accuracy. Therefore, in this work, we present a fingerprint map construction technique based on location fix determination and fingerprint matching motivated by the availability of advanced sensing capabilities in smartphones to reduce the time and labour cost required for the site survey. The proposed Location Fixing and Finger Matching (LFFM) method use a landmark graph-based localization approach to automatically estimate the location fixes for the Reference Points and matching the collected fingerprints, without requiring active user participation. Experimental results show that the proposed LFFM is faster than the manual fingerprint map construction method and remarkably improves the positioning accuracy.


---

## Body

## 1. Introduction

With the increase of ubiquitous deployment of Wi-Fi infrastructures both at indoor and at outdoor environments together with the exponential multiplication of mobile computing devices, intense attention has been paid to various approaches of Wi-Fi network aided location tracking [1]. Such positioning methods are extremely useful in applications such as visitor navigation in museums or large buildings where GPS signal is not available: elderly health care positioning systems, facility management, transportation, and emergency rescue [2, 3]. In this respect, fingerprinting techniques became particularly popular for indoor localization.More formally, utilizing the existing Wi-Fi infrastructures [4], the fingerprinting approach involves two distinct phases: offline map construction and online location estimation. In the offline phase, a site survey is conducted to collect Received Signal Strength (RSS) at known locations called Reference Points (RPs), which usually contain the Media Access Control (MAC) address of visible Access Points (APs). The RPs’ coordinates along with their corresponding RSSs are then stored in a radio map database. The latter is used in the second phase, referred to testing or online phase, which, through some interpolation or machine learning-based technique, enables the system to infer the position of an unknown (mobile) target given its RSS value. Nevertheless, radio map construction often requires a large number of locations—labelled RSS fingerprints—gathered from either wireless APs or RPs, often evenly distributed within the area of interest, in order to ensure a good positioning accuracy during the testing phase. Besides, in order to account for the inherent deficit of wireless signal propagation, several samples, executed with special care, are needed at each measurement.Therefore, and from our personal experiences as mentioned in [5], a major challenge in constructing efficient radio map is the expensive time requirement and labour-intensive site survey process, hindering a wide set of potential applications, which, in turn, promote RSS fingerprinting localization-based techniques. Besides, the complex and dynamic nature of the indoor wireless environment, which makes radio map maintenance difficult as the signal, is easily influenced by the structures, layout, and pedestrians around the study site. In order to deal with the radio map construction challenge, many research works have been performed to expedite the site survey process while ensuring high-quality standards. For instance, the Simultaneous Localization and Mapping (SLAM) [6–8] can be used to construct the radio map with lower survey cost, but it may be unsuitable to work on the resource-limited handheld devices such as smartphones due to its heavy computation load [9]. Although many map management methods (e.g., Map Filtering [10] and pedestrian dead-reckoning [11]) can be employed to infer a user’s initial location and improve SLAM performance accordingly, their associated high computational cost restricts their implementation in resource-limited ubiquitous devices. Alternatively, the crowdsourcing-based radio map construction has been proposed recently in both active and passive formats [10]. While the active crowdsourcing method requires active user participation, which reduces the need for professional surveyors, it may suffer from intentional frauds due to user participation. On the other hand, the passive crowdsourcing approach reduces user participation by utilizing information from smartphone inertial sensors in order to associate fingerprints to the corresponding RPs. Although the passive crowdsourcing is more practical, its main drawback lies in the low accuracy and the need for GPS readings, which, in turn, may constrain the application scope [12]. Therefore, using the high-end smart devices that are equipped with a variety of sensors (e.g., a barometer that detects floor change in the building) can be vital to improving user experience and crowdsourcing-based radio map construction, which, ultimately, enhances the indoor localization system and expands the applicability of the underlying localization services. However, the accumulated error of many inertial sensors grows over time for instance gyroscope; also, to the potential uncertainty pervading the locations of APs, it may force special care and a regular update that utilizes the environment knowledge.In this respect, a new passive fingerprint crowdsourcing method has been proposed in this paper. More formally, this work proposes a landmark graph-based localization method for automatically estimating the location of RPs matched with the collected fingerprints in order to design a practical, fast, and reliable fingerprint data collection method using sensor-rich smart devices. Compared to other existing methods, our technique can significantly build a fast fingerprint map with a minimum user participation while ensuring high standards in terms of accuracy and reliability due to the incorporating of abelief factor that accounts for the RPs and assesses the quality of location fixes of RPs, so that only those location fixes that are associated with high quality are matched with the corresponding fingerprints. This achieves better location accuracy than Map Filtering and Pedestrian Dead Reckoning (PDR) [13]. Besides, the accuracy of the constructed radio map is compared to state-of-the-art approaches ZEE [10] and manual fingerprint map building techniques [14].The rest of this paper is organized as follows: Section2 describes the related work in the field. Section 3 details the proposed system, while Section 4 describes the LFFM technique based on a landmark graph, Section 5 describes the fingerprint map construction, Section 6 explains the experimental findings, and Section 7 draws the conclusion.


## 2. Related Work

Indoor localization has been an active area of research for the past three decades, initially in the context of mobile robot navigation and more recently in the context of pervasive and mobile computing where the issue of environment mapping is crucial for a variety of applications requiring various levels of accuracy. In this course, one distinguishes approaches that make use of existing infrastructures (e.g., Wi-Fi APs as in RADAR [15]) and those that require special deployment infrastructure (e.g., infrared beacons as in Active Badge [16] and ultrasound devices as in Cricket [17]). In the area of mobile robotics, a significant step was achieved by the emergence of Simultaneous Localization and Mapping (SLAM) which allowed a robot to build a map of the indoor environment, usually, in terms of walls and other obstruction objects, while simultaneously determining its location with respect to the constructed map.In the SLAM group, special attention has been drawn to the offline map construction techniques that often employ motion and system models, where several approaches have been proposed, typically, such methods differ according to the employed sensors, type of prior knowledge available, and the used mapping techniques [6–8]. For instance, one may distinguish the recently populated GraphSLAM [18], which transforms the SLAM posterior into a graphical network, where a greedy algorithm is usually used for data association. Traditionally, the positions of landmarks (objects) in the environment are estimated using a laser range finder like a sensor (either fixed or scanning through the environment) embedded in some mobile platform, which yields a relatively accurate estimate of the RPs with respect to the local frame. A critical assumption is that these landmarks do not change position during the journey. In the case of nonstatic of either the mobile platform or landmarks, due to the accumulation of the relative positioning error throughout the journey, a correction step is required, yielding an updated map of the environment. For example, the WiFi-SLAM system proposed in [8] uses a Gaussian Process Latent Variable Model to associate Wi-Fi fingerprints in combination with a motion dynamics model without requiring any location labels in the training data. Authors in [19] used GraphSLAM in order to improve the computational efficiency of the WiFi-SLAM system and relieve its dependency on the requirement of fingerprint uniqueness assumption. WiSLAM [7] uses a Bayesian framework to fuse WiFi RSS with data from a foot mounted inertial measurement units for localization and mapping. In [6], a Smart SLAM is proposed to construct a radio map through a fruitful combination of different fusion algorithms, namely, PDR algorithm, Fingerprint Extended Kalman Filter (FEKF), Fingerprint Extended Kalman Filter SLAM (FEKF-SLAM), and Distributed Particle SLAM (DPSLAM). However, the heavy computation load of these SLAM systems prevents them from being implemented on resource-limited handheld devices such as smartphones. Moreover, another disadvantage of such filtering-like techniques is that the data, once processed, is often discarded. This makes it impossible to revisit all data at the time of a map building task [18].In contrast to those above computationally expensive map building techniques and costly labour-based site survey methods, crowdsourcing has emerged as a natural participatory model that benefits from daily user activities and widespread of smartphone devices. In this respect, one distinguishes active crowdsourcing [20–22] and passive crowdsourcing [10, 23, 24]. The active crowdsourcing methods construct a radio map by utilizing the user feedback where the surveyors are volunteers who decided to share RSS signal at specific locations of the environment. Especially, authors in [9–11] highlighted several clear advantages of such techniques. First, the underlined radio map can provide robust and accurate fingerprint data even when it is built solely on short-duration RSS measurements. Second, there is no constraint on the type and the number of devices employed. As a result, the active crowdsourcing eliminates the need for costly professional surveyors. Nevertheless, this should not hide some implicit limitations as well. For instance, since users carry heterogeneous devices, this can result in a radio map built where RSS values originated from diverse devices with distinct chipsets and antenna designs, which affect the calibration or consistency of employed radio model, even when the devices were placed at exactly the same positions. It can also result in holes in terms of data sparsity with no designated fingerprint collection points. Indeed, since the radio map is updated by untrained voluntary users without centralized controls, different users can upload their fingerprint data that is collected at slightly different locations but with the same location label. Multiple fingerprint data indicating one particular location not only cause slow location estimation but also store space wastage in a radio map server. Finally, since it requires active user participation, this technique may suffer from intentional frauds [20]. A particular example of an active crowdsource system the Organic Indoor Location (OIL) [20] that periodically asks the users to bind their measurements along with their locations on the floor plan, providing information about the nearby wireless resources, then the determined position is reflected into a global map. Similarly, FreeLoc [21] and Mobile Organic Localization Engine (Mol’e) [22] use semantic labels rather than exact floor maps to annotate fingerprints with locations such as rooms, hallways, and corridors.On the other hand, passive crowdsourcing methods associate fingerprints with the corresponding RPs with the aid of smartphone inertial sensors. For example, EZ [23] uses occasional GPS fixes together with reported RSS measurements of specific APs arising from users’ participation to build a radio map that does not require any predeployment effort. Nevertheless, the reliance on the method on the existence of occasional GPS fixes might be an issue in an indoor environment, which delays the map construction until the availability of GPS signal. Zee [10] utilizes smartphone inertial sensors to track the user while performing Wi-Fi scan simultaneously, which enabled the authors to construct a radio map in a nonintrusive way. However, the approach uses magnetometers to calculate the direction, which is easily affected by building structure, service amenities, and furniture in indoor environments. Besides, its use of the particle filter to fuse inertial sensors with a floor plan is computationally expensive, which makes it unsuitable for running on resource-limited devices. LiFS [24] builds the radio map by exploiting the built-in sensors of the mobile device with the floor plan of the testing environment, which resulted in a relatively fast deployment process and a less labour effort. Especially, it was shown that LiFS works well in buildings exhibiting some spatial symmetry of the environment layout; e.g., office rooms are connected by a corridor and are equally distributed on both sides of the corridor, but may fail to work on other types of buildings. Although the passive crowdsourcing significantly reduces the labour cost of site surveying task and does not require active user participation, it has several problems too. This includes low accuracy, limited applicability to hand-device implementation constraints, and more importantly the requirement for GPS readings. Table 1 summarizes some of the most common fingerprint map construction techniques.Table 1
Fingerprint map construction techniques.
Methods
System name
Algorithm and requirements
Accuracy of RM
Testbed area
Crowdsourcing
RedPIN [25]
Label position by user, indoor map
Room level (90%)
26 rooms
Molé [22]
Kernel, accelerometer
Room level (91%)
3-floor building
FreeLoc [21]
Relative RSS comparison
<3 m
A laboratory, a corridor
SLAM
WiFi-SLAM [8]
GP-LVM, initial ISO map model
3.97 m (ME)
250–500 m (traces)
SignalSLAM [26]
Least square, PDR, GraphSLAM, landmarks, accelerometer, gyroscope, magnetometer
<16.5 m (MD)
200m×160m
Graph-SLAM [18, 19]
Sparse graph, constraint optimization, least square, linearization, approximation, EKF SLAM, accelerometer, GPS
<10 m
Urban area600m×800m
Inertial sensors
Zee [10]
DR, augmented particle filter, indoor map, accelerometer, gyroscope, magnetometer
1.2 m (50%), 1.8 m (80%)
65m×35m
LiFS [24]
DR, feature extraction, indoor map, accelerometer
5.88 m (ME)
70m×23m
WILL [27]
PDR,K-means, accelerometer
Room level (86%)
70m×23m
Semisupervised learning
Manifold learning [28]
Manifold alignment, inherent spatial correlation of RSS, path loss model, partial RPs, APs’ locations, indoor map
3.8 m (ME); 2.4 m (ME)
40m×30m, 5 APs; 40m×20m, 4 APs
Coforest [29]
Implicit crowdsourcing sampling, random forest ensemble classifier, partial RPs, RSS
3.65 m (ME)
800 m2, 30 APs
Unsupervised learning
WRM [30, 31]
HMM, EM, memetic algorithm, path loss model, indoor map, APs’ locations
Around 3 m (ME)
80m×32m, 30 APs
Path loss model
ARIADNE [32]
Ray tracing, path loss model, simulated annealing algorithm, APs’ location, partial RPs, indoor map
3 m (ME), 2.5 m (STD)
65m×48m, 5 APs
Multiwall Path Loss Model (MWM) [33]
MWM, APs’ location, indoor map, parameters setting for Gaussian distribution, Euclidean distance error, kNN
1.2 m (ME)
480 m2, 3 APs
Interpolation
Inverse Distance Weighting (IDW) [34]
RSS, interpolation and extrapolation methods, estimation error statistics, uniform grid, IDW, probabilistic positioning
5~20 m (ME)
150m×60m, 316 2.4 GHz APs, 106 5 GHz APs
Kriging [35]
Kriging algorithm, spatial interpolation, semivariogram model fitting, unbiased estimation, RSS,K-weighted nearest neighbours,
1.12 m (ME)
9.5 m × 2.5 m, 9 APs
Forward Interpolation [36]
cubic spline, boundary condition (fixed, zero-slope natural, nonnode), RMS, RSS
2.82 m (best)
5 rooms, 4 APsOur work falls in the class of methods that rely on the existing infrastructure, namely, Wi-Fi network, without recourse to any additional deployment or detailed floorplan and exact AP placements, which distinguishes it from works in [20, 22]. Similarly, our approach also belongs to the class of passive crowdsourcing methods in the sense of enabling random smartphone users to participate in the radio map construction task as in [21], but with the additional step of utilizing inertial device sensory information in order to estimate the RPs positions. In addition, our approach introduces a confidence factor (called belief factor) that accounts for the quality of location fixes of RPs, so that only those location fixes that are associated with high quality are matched with the corresponding fingerprints. Our approach also bears similarity with Gu et al.’s work [13] that makes use of mobile inertial sensors for position estimation but with the additional use of crowdsourcing technology and confidence factor analysis in the pattern-matching task. Likewise, our work bears similarity with EZ’s approach [23] with the difference that our proposal does not require any GPS fixe locations, making use of device inertial sensors. Besides, we also restrict to cases where some prior information about the environment through floor plan is provided, which excludes fully unknown environment scenarios as in some other studies.


## 3. System Overview

The outline of the proposed fingerprint collecting technique based on Location Fixing and Fingerprint Matching (LFFM) is shown in Figure1. It is composed of two main modules: Location Fixing of RPs and Fingerprint Matching.Figure 1
System architecture.The Location Fixing module receives measurements from the built-in smartphone sensors and is fed with a landmark graph [13]. The sensor measurements—basically, barometer, accelerometer, gyroscope, and magnetometer—are used to determine the step size and directional heading of the particular user using the well-known Pedestrian Dead Reckoning (PDR) method described in [37]. The estimated step size and directional heading are then employed to infer the current user position in real time with respect to the landmarks according to the provided landmark graph. In this respect, a landmark processing task is necessary in order to reduce the error accumulation of the PDR, in addition to position calibration based on landmark detection.The Fingerprint Matching module uses the fixed locations estimated by the Location Fixing module and the scanned Wi-Fi signal information (MAC address and corresponding RSS) to generate the fingerprint radio map. Location estimates together with the corresponding match fingerprint are then added into the radio map—only if they meet a certain quality requirement, which will be detailed later on. This constraint is added to guarantee the accuracy and reliability of the generated fingerprint map. More details on the algorithm will be elaborated in the next section. However, initially, Table2 will help the reader to navigate through the article by providing a list of abbreviations.Table 2
List of abbreviations.
Rbar
Barometer landmark rule
Racc
Accelerometer landmark rule
Rgyr
Gyroscope landmark rule
βbar1
Barometer horizontal movement threshold
βbar2
Barometer vertical movement threshold
pi
Pressure of theith window of air pressure readings at time t
mt
Represents the motion state (e.g., walking and stationary) at timet
β1
Accelerometer threshold for walking state
β2
Accelerometer threshold for steady state
θ̇t
Gyroscope measurement along the vertical direction
βgyr
Gyroscope threshold
St
Step length
θt
Heading direction
Pt
Pressure values at timet
Pdiffa,b
Pressure difference between floora and floor b
conlk
Confidence level of land mark
δRk,Rt∗
Validity of rule detection
rθk,θt∗
Validity of path detection
gdk,dt∗
Ratio of moved distance
βθ
Heading direction threshold
βcon
Confidence threshold
PS
Path segment connecting two neighbour landmarks
belPS
Quality belief of path segmentPS
T
Step periodicity
βbelPS
Threshold of belief valuebelPS of the path segment PS
Tr
Trajectory


## 4. Location Fixing and Fingerprint Matching (LFFM) Based on Landmark Graph

### 4.1. Landmark Detection

Our approach utilizes the fact that naturally spread smartphones in indoor environments are rich with powerful sensors and sensing ability. In our work, a landmark will refer to spatial points where sensor measurements indicate an identifiable and distinguishable pattern or change in pattern. For example; corners and turns will force users to change walking direction, while, stairs and elevators are highlighted by elevation change. Similarly, doors are triggered whenever a change in the velocity is identified, and thus, a movement pattern can be predicted.For this purpose, we utilize information issued from inertial sensors, mainly, barometer, gyroscope, and accelerometer for landmark detection. The detection of landmarks is based on the distinct change of pattern in one or more types of sensor readings. The locations of these landmarks correspond to the locations of elevators, stairs, corners, turns, and doors that can be simply obtained from floor plans, which is usually available for most indoor environments.More formally, a landmarkL can be defined as
(1)L:<x,y,z,R1,⋯,RN>,where x,y,z denotes the location of the landmark according to the underlined floor plan and R1,⋯,RN represents the set of detection rules, according to the different types of sensor measurements, satisfied by the corresponding landmark, where N corresponds to the number of rules triggered by this landmark. Typically, each device inertial sensor would trigger one or more rules associated to the constraints on the measurement values/patterns linked to each landmark type.


#### 4.1.1. Barometer-Based Landmark

The barometer sensor measurements provide information about vertical movement detection, for example, a user going upstairs, going downstairs, or taking an elevator, since the barometric value changes with the altitude or height. Although the barometric pressure is influenced by many factors such as temperature and altitude, due to the relatively instantaneous measurement time, such factors are discarded in this work, and we only account for altitude information. The change in the barometer readings, when a user walks horizontally, upstairs/downstairs, or takes the elevator, can be shown in Figure2.Figure 2
Barometer readings on changing elevations.Here, the entrance and exit of stairs and elevators are considered barometer landmarks due to their pattern representation in barometer pressure measurements, since it is distinctive, identifiable, and stable. The entrance detection includes a “horizontal movement→vertical movement” pattern. Similarly, the exit detection includes a “vertical movement→horizontal movement” pattern.More formally, having observed the change in barometer readings as shown in Figure2, where it is almost a linear change when the user moves vertically, in this case, the linear model can be used to fit those readings; then, let pi denote the pressure of the ith window of air pressure readings at time t, and let βbar1 and βbar2 be the thresholds used to detect horizontal movement and vertical movement, respectively. Then Rbar rule to detect the entrance to a set of staircases or an elevator can be defined by the following rule:
(2)Rbar1:loctwhenpi−pi−1<βbar1ANDS1==Kp1ANDpi+Kp1−pi>βbar2.The first term is for detecting horizontal movement, and the latter two terms are for detecting vertical movement. The thresholdsβbar1and βbar2 on horizontal and vertical movements are set manually after an extensive testing phase. Although many algorithms can be used to determine the thresholds experimentally [38], for the time being, it is out of the scope of this work, thus all the thresholds are set manually based on the empirical test as shown in Table 2, for example, and as illustrated in Figure 2, βbar1 can be calculated as 1013.4−1013.2/4sec=0.05hPa for every second in case of going up or down on the stairs.The functionS1 can be defined as
(3)S1=∑j=i+1i+Kp1sgnpj−pj−1,where sgn is the signum function, which can be described as
(4)sgnpj−pj−1=1,ifpj>pj−1,0,ifpj=pj−1,−1,ifpj<pj−1.Similarly, the rule to detect the exit from a set of staircases or an elevator can be defined by the following rule:(5)Rbar2:loctwhenpi−pi+1<βbar1ANDS2==Kp2ANDpi+Kp2−pi>βbar2.Then the functionS2 can be defined in the same spirit of (2):
(6)S2=∑j=i−Kp2+1i+Kp1sgnpj−pj−1.The two valuesKp1 and Kp2 are not constant, but are determined dynamically. Their initial values can be set to 1 and gradually increase as long as the value of the signum function was kept unchanged.


#### 4.1.2. Accelerometer-Based Landmark

The motion that presents a distinct change pattern can also be measured by the accelerometer. It can be considered, where a point that witnesses the changing pattern of “walking→steady→walking” (of course for an acceptable short period, i.e., one second or few seconds) can be regarded as a potential accelerometer landmark (the termstill or steady refers to motionless action). This pattern may happen when passing doors as shown in Figure 3 or passing water fountain, which can be detected by comparing the magnitude of the accelerometer measurement against a predefined threshold (which is again set based on empirical results). A location point is regarded as an accelerometer landmark if the accelerometer readings present this changing pattern every time the user passes it. Formally, the rule Racc of accelerometer landmarks is defined by the following rule:
(7)Racc:loctwhenmt−β1:tiswalkingANDmt:t+β2issteadyANDmt+β1iswalking,where mt represents the motion state (e.g, walking, steady) at time t. β1 and β2 are two thresholds that are set empirically to determine the period of the corresponding motion state.Figure 3
Accelerometer reading example when passing door landmark.


#### 4.1.3. Gyroscope-Based Landmark

A location point where the gyroscope measurements present a distinct and stable pattern is considered a gyroscope landmark. The magnetometer can also be used to detect a change in direction, but its measurements tend to be affected by ferromagnetic materials. Therefore, gyroscope measurements seem to be more suitable for detecting the change in direction in our experiment. The target is to determine the right and left turn patterns as shown in Figure4. This pattern can usually be witnessed at the location of a turn, corner, or door. The rule Rgyr to detect a gyroscope landmark can be set as
(8)Rgyr:loctwhenθ̇t>βgyr,where θ̇t is the gyroscope measurement along the vertical direction. When the absolute value of θ̇t is greater than a certain threshold βgyr, this location point can be considered a potential gyroscope landmark. Trivially, the initial direction heading can be set to north or south depending on the underlying environment orientation.Figure 4
Gyroscope readings on right and left turns.


### 4.2. Landmark Graph for Location Fixing of RPs

A landmark graph can be defined as a directed graph where nodes are landmarks and edges are accessible paths with heading information.LetG=L,E denote a landmark graph where L=l1,l2,⋯,lN is a set of landmarks and E=e1,e2,⋯,eM is the set of edges in graph G. Each edge ei consists of the two landmarks, direction from one landmark to another, and the corresponding distance between them, ei=<lj,lk,θjk,di>. Note that the direction from landmark lj to landmark lk is different from that from lk to landmark lj. In other words, there are two edges between any two neighbour landmarks. The general algorithm for Location Fixing and Fingerprint Matching (LFFM) using a landmark graph in indoor localization is shown in Figure 5.Figure 5
Landmark detection algorithm.The details of each task in Figure5 is commented as follows:
(1)
The construction of the landmark graph requires location landmarks, which can be extracted from a floor plan. Most buildings are symmetric. For instance, floors of the same building have a similar or almost identical layout, so that by changing floor information on its landmark graph, we can easily obtain the landmark graph for another floor
(2)
The step detection is done via detecting acceleration peaks, where each acceleration peak corresponds to one step. In order to distinguish the walking state from the steady state, we check if the change of the acceleration within the detected time window is greater than the set threshold. If a step is detected, then the corresponding heading direction and step size are computed
(3)
Using the inertial sensor measurements and the PDR technique, the user’s position at each step can be calculated given his/her initial location as follows:(9)xt=xt−1+Stsinθt,(10)yt=yt−1+Stsinθt,(11)ft=ft−1−Pt−Pt−1Pdiffa,b,where xt and yt are the user coordinates at floor ft at time t and St is the corresponding step length and θt the heading direction. Pt and Pt−1 are the air pressure values at time t and t−1, respectively. And Pdiffa,b is the air pressure difference between floor a and floor b. Adding the threshold values for both step detection and direction heading will ensure values and of course a robust position when these landmarks are added later to the localization map
(4)
While the PDR is conducted to estimate the location of the user, the measurements from the barometer, gyroscope, and accelerometer are simultaneously used to detect landmarks. Although both the gyroscope readings and compass readings (inferred from accelerometer readings and magnetometer readings) can be used to estimate the heading, they cannot provide a robust heading estimation since the gyroscope has the drift problem and the compass is vulnerable to ferromagnetic materials [39]. Therefore, the landmark graph is used to assist with the heading direction estimation. If a user is detected to walk on the path connecting two landmarks in the landmark graph, the heading from this landmark graph will be used. Otherwise, the compass readings will be used as the heading. Also, the step size is updated when a user passes two neighbouring landmarks in the landmark graph. Let l1 and l2 indicate the two neighbour landmarks that a user passes subsequently. Given the x,y coordinates of each of these landmarks, and the number NS of detected steps between them; then the step size S can be calculated as follows:
(12)S=Xl1−Xl22+Yl1−Yl22NSThe step size estimation method does not require the user’s stature information and can adapt to varying walking speeds, and it is updated as the user passes two neighbour landmarks on the landmark graph.Using landmarks for assisting localization may result in a need to solve the data association issue [40], in other words, when there are multiple landmarks nearby, or when there is a case that one or more landmarks are missed from sensor data, or mainly it can be used to avoid false detections.We need to have a measure of how much confidence a location points meeting the landmark detection rule. The confidence that a location point is matching should be constrained by the following facts; first, the detected landmark should be a valid detection for one of the landmark types; second, it has to fall within the same moving direction; in other words, there should be somehow a path between the estimated landmark at a specific time and the landmark at an earlier time; third, it has to have an acceptable distance from the previous detection. Formally, letlk be a landmark then the confidence conlk in the landmark graph can be calculated as
(13)conlk=δRk,Rt∗·rθk,θt∗·gdk,dt∗,where k is the index of a landmark in the landmark graph, Rk is the detection rule of the reference landmark lk, and Rt∗ is the type of the detected landmark at time t; then δRk,Rt∗ is the validity function of the detected landmark, with δ as the Dirac delta function that is denoted as
(14)δRk,Rt∗=1,ifRk=Rt∗,0,otherwise.From (13), where θk and θt∗ are the reference heading and the estimated heading from the time visiting the last landmark to time t. Then, the path validity r is the rectangle function adopted from our earlier work [14] and can be described as
(15)rθk,θt∗=1,ifθk−θt∗<βθ,0,otherwise,where βθ is a heading direction threshold, when dk and dt∗ are the reference distance and the traveled distance from the last landmark to the location point. Then the distance weight function g is defined as
(16)gdk,dt∗=1dk−dt∗.Once every landmark is being associated with a confidence level, then, when multiple landmarks are nearby, the one with the highest confidence factor will be selected. Moreover, fake landmarks may occur due to user unpredictable actions, for instance making a turn in the middle of the corridor, which may be resulting in detection of a gyroscope landmark. To solve this issue, a confidence thresholdβcon value may be used as such as
(17)lk:conlk≥βcon,∀lk:x,yt.In some other cases, when landmarks are missed from sensor data, for instance, certain landmarks at the locations of doors can be missed if a door is left open since “walking→steady→walking” behaviour pattern will not be detected. In such a case, we have no option but to ignore the underlined landmark, which may result in increasing the accumulation error. But this error will be reduced back when the next landmark is detected since after the addition of every landmark the graph will be denser, having more nodes and, definitely, more connective paths, which will result in reducing the chance of error for the upcoming detections.


## 4.1. Landmark Detection

Our approach utilizes the fact that naturally spread smartphones in indoor environments are rich with powerful sensors and sensing ability. In our work, a landmark will refer to spatial points where sensor measurements indicate an identifiable and distinguishable pattern or change in pattern. For example; corners and turns will force users to change walking direction, while, stairs and elevators are highlighted by elevation change. Similarly, doors are triggered whenever a change in the velocity is identified, and thus, a movement pattern can be predicted.For this purpose, we utilize information issued from inertial sensors, mainly, barometer, gyroscope, and accelerometer for landmark detection. The detection of landmarks is based on the distinct change of pattern in one or more types of sensor readings. The locations of these landmarks correspond to the locations of elevators, stairs, corners, turns, and doors that can be simply obtained from floor plans, which is usually available for most indoor environments.More formally, a landmarkL can be defined as
(1)L:<x,y,z,R1,⋯,RN>,where x,y,z denotes the location of the landmark according to the underlined floor plan and R1,⋯,RN represents the set of detection rules, according to the different types of sensor measurements, satisfied by the corresponding landmark, where N corresponds to the number of rules triggered by this landmark. Typically, each device inertial sensor would trigger one or more rules associated to the constraints on the measurement values/patterns linked to each landmark type.


### 4.1.1. Barometer-Based Landmark

The barometer sensor measurements provide information about vertical movement detection, for example, a user going upstairs, going downstairs, or taking an elevator, since the barometric value changes with the altitude or height. Although the barometric pressure is influenced by many factors such as temperature and altitude, due to the relatively instantaneous measurement time, such factors are discarded in this work, and we only account for altitude information. The change in the barometer readings, when a user walks horizontally, upstairs/downstairs, or takes the elevator, can be shown in Figure2.Figure 2
Barometer readings on changing elevations.Here, the entrance and exit of stairs and elevators are considered barometer landmarks due to their pattern representation in barometer pressure measurements, since it is distinctive, identifiable, and stable. The entrance detection includes a “horizontal movement→vertical movement” pattern. Similarly, the exit detection includes a “vertical movement→horizontal movement” pattern.More formally, having observed the change in barometer readings as shown in Figure2, where it is almost a linear change when the user moves vertically, in this case, the linear model can be used to fit those readings; then, let pi denote the pressure of the ith window of air pressure readings at time t, and let βbar1 and βbar2 be the thresholds used to detect horizontal movement and vertical movement, respectively. Then Rbar rule to detect the entrance to a set of staircases or an elevator can be defined by the following rule:
(2)Rbar1:loctwhenpi−pi−1<βbar1ANDS1==Kp1ANDpi+Kp1−pi>βbar2.The first term is for detecting horizontal movement, and the latter two terms are for detecting vertical movement. The thresholdsβbar1and βbar2 on horizontal and vertical movements are set manually after an extensive testing phase. Although many algorithms can be used to determine the thresholds experimentally [38], for the time being, it is out of the scope of this work, thus all the thresholds are set manually based on the empirical test as shown in Table 2, for example, and as illustrated in Figure 2, βbar1 can be calculated as 1013.4−1013.2/4sec=0.05hPa for every second in case of going up or down on the stairs.The functionS1 can be defined as
(3)S1=∑j=i+1i+Kp1sgnpj−pj−1,where sgn is the signum function, which can be described as
(4)sgnpj−pj−1=1,ifpj>pj−1,0,ifpj=pj−1,−1,ifpj<pj−1.Similarly, the rule to detect the exit from a set of staircases or an elevator can be defined by the following rule:(5)Rbar2:loctwhenpi−pi+1<βbar1ANDS2==Kp2ANDpi+Kp2−pi>βbar2.Then the functionS2 can be defined in the same spirit of (2):
(6)S2=∑j=i−Kp2+1i+Kp1sgnpj−pj−1.The two valuesKp1 and Kp2 are not constant, but are determined dynamically. Their initial values can be set to 1 and gradually increase as long as the value of the signum function was kept unchanged.


### 4.1.2. Accelerometer-Based Landmark

The motion that presents a distinct change pattern can also be measured by the accelerometer. It can be considered, where a point that witnesses the changing pattern of “walking→steady→walking” (of course for an acceptable short period, i.e., one second or few seconds) can be regarded as a potential accelerometer landmark (the termstill or steady refers to motionless action). This pattern may happen when passing doors as shown in Figure 3 or passing water fountain, which can be detected by comparing the magnitude of the accelerometer measurement against a predefined threshold (which is again set based on empirical results). A location point is regarded as an accelerometer landmark if the accelerometer readings present this changing pattern every time the user passes it. Formally, the rule Racc of accelerometer landmarks is defined by the following rule:
(7)Racc:loctwhenmt−β1:tiswalkingANDmt:t+β2issteadyANDmt+β1iswalking,where mt represents the motion state (e.g, walking, steady) at time t. β1 and β2 are two thresholds that are set empirically to determine the period of the corresponding motion state.Figure 3
Accelerometer reading example when passing door landmark.


### 4.1.3. Gyroscope-Based Landmark

A location point where the gyroscope measurements present a distinct and stable pattern is considered a gyroscope landmark. The magnetometer can also be used to detect a change in direction, but its measurements tend to be affected by ferromagnetic materials. Therefore, gyroscope measurements seem to be more suitable for detecting the change in direction in our experiment. The target is to determine the right and left turn patterns as shown in Figure4. This pattern can usually be witnessed at the location of a turn, corner, or door. The rule Rgyr to detect a gyroscope landmark can be set as
(8)Rgyr:loctwhenθ̇t>βgyr,where θ̇t is the gyroscope measurement along the vertical direction. When the absolute value of θ̇t is greater than a certain threshold βgyr, this location point can be considered a potential gyroscope landmark. Trivially, the initial direction heading can be set to north or south depending on the underlying environment orientation.Figure 4
Gyroscope readings on right and left turns.


## 4.1.1. Barometer-Based Landmark

The barometer sensor measurements provide information about vertical movement detection, for example, a user going upstairs, going downstairs, or taking an elevator, since the barometric value changes with the altitude or height. Although the barometric pressure is influenced by many factors such as temperature and altitude, due to the relatively instantaneous measurement time, such factors are discarded in this work, and we only account for altitude information. The change in the barometer readings, when a user walks horizontally, upstairs/downstairs, or takes the elevator, can be shown in Figure2.Figure 2
Barometer readings on changing elevations.Here, the entrance and exit of stairs and elevators are considered barometer landmarks due to their pattern representation in barometer pressure measurements, since it is distinctive, identifiable, and stable. The entrance detection includes a “horizontal movement→vertical movement” pattern. Similarly, the exit detection includes a “vertical movement→horizontal movement” pattern.More formally, having observed the change in barometer readings as shown in Figure2, where it is almost a linear change when the user moves vertically, in this case, the linear model can be used to fit those readings; then, let pi denote the pressure of the ith window of air pressure readings at time t, and let βbar1 and βbar2 be the thresholds used to detect horizontal movement and vertical movement, respectively. Then Rbar rule to detect the entrance to a set of staircases or an elevator can be defined by the following rule:
(2)Rbar1:loctwhenpi−pi−1<βbar1ANDS1==Kp1ANDpi+Kp1−pi>βbar2.The first term is for detecting horizontal movement, and the latter two terms are for detecting vertical movement. The thresholdsβbar1and βbar2 on horizontal and vertical movements are set manually after an extensive testing phase. Although many algorithms can be used to determine the thresholds experimentally [38], for the time being, it is out of the scope of this work, thus all the thresholds are set manually based on the empirical test as shown in Table 2, for example, and as illustrated in Figure 2, βbar1 can be calculated as 1013.4−1013.2/4sec=0.05hPa for every second in case of going up or down on the stairs.The functionS1 can be defined as
(3)S1=∑j=i+1i+Kp1sgnpj−pj−1,where sgn is the signum function, which can be described as
(4)sgnpj−pj−1=1,ifpj>pj−1,0,ifpj=pj−1,−1,ifpj<pj−1.Similarly, the rule to detect the exit from a set of staircases or an elevator can be defined by the following rule:(5)Rbar2:loctwhenpi−pi+1<βbar1ANDS2==Kp2ANDpi+Kp2−pi>βbar2.Then the functionS2 can be defined in the same spirit of (2):
(6)S2=∑j=i−Kp2+1i+Kp1sgnpj−pj−1.The two valuesKp1 and Kp2 are not constant, but are determined dynamically. Their initial values can be set to 1 and gradually increase as long as the value of the signum function was kept unchanged.


## 4.1.2. Accelerometer-Based Landmark

The motion that presents a distinct change pattern can also be measured by the accelerometer. It can be considered, where a point that witnesses the changing pattern of “walking→steady→walking” (of course for an acceptable short period, i.e., one second or few seconds) can be regarded as a potential accelerometer landmark (the termstill or steady refers to motionless action). This pattern may happen when passing doors as shown in Figure 3 or passing water fountain, which can be detected by comparing the magnitude of the accelerometer measurement against a predefined threshold (which is again set based on empirical results). A location point is regarded as an accelerometer landmark if the accelerometer readings present this changing pattern every time the user passes it. Formally, the rule Racc of accelerometer landmarks is defined by the following rule:
(7)Racc:loctwhenmt−β1:tiswalkingANDmt:t+β2issteadyANDmt+β1iswalking,where mt represents the motion state (e.g, walking, steady) at time t. β1 and β2 are two thresholds that are set empirically to determine the period of the corresponding motion state.Figure 3
Accelerometer reading example when passing door landmark.


## 4.1.3. Gyroscope-Based Landmark

A location point where the gyroscope measurements present a distinct and stable pattern is considered a gyroscope landmark. The magnetometer can also be used to detect a change in direction, but its measurements tend to be affected by ferromagnetic materials. Therefore, gyroscope measurements seem to be more suitable for detecting the change in direction in our experiment. The target is to determine the right and left turn patterns as shown in Figure4. This pattern can usually be witnessed at the location of a turn, corner, or door. The rule Rgyr to detect a gyroscope landmark can be set as
(8)Rgyr:loctwhenθ̇t>βgyr,where θ̇t is the gyroscope measurement along the vertical direction. When the absolute value of θ̇t is greater than a certain threshold βgyr, this location point can be considered a potential gyroscope landmark. Trivially, the initial direction heading can be set to north or south depending on the underlying environment orientation.Figure 4
Gyroscope readings on right and left turns.


## 4.2. Landmark Graph for Location Fixing of RPs

A landmark graph can be defined as a directed graph where nodes are landmarks and edges are accessible paths with heading information.LetG=L,E denote a landmark graph where L=l1,l2,⋯,lN is a set of landmarks and E=e1,e2,⋯,eM is the set of edges in graph G. Each edge ei consists of the two landmarks, direction from one landmark to another, and the corresponding distance between them, ei=<lj,lk,θjk,di>. Note that the direction from landmark lj to landmark lk is different from that from lk to landmark lj. In other words, there are two edges between any two neighbour landmarks. The general algorithm for Location Fixing and Fingerprint Matching (LFFM) using a landmark graph in indoor localization is shown in Figure 5.Figure 5
Landmark detection algorithm.The details of each task in Figure5 is commented as follows:
(1)
The construction of the landmark graph requires location landmarks, which can be extracted from a floor plan. Most buildings are symmetric. For instance, floors of the same building have a similar or almost identical layout, so that by changing floor information on its landmark graph, we can easily obtain the landmark graph for another floor
(2)
The step detection is done via detecting acceleration peaks, where each acceleration peak corresponds to one step. In order to distinguish the walking state from the steady state, we check if the change of the acceleration within the detected time window is greater than the set threshold. If a step is detected, then the corresponding heading direction and step size are computed
(3)
Using the inertial sensor measurements and the PDR technique, the user’s position at each step can be calculated given his/her initial location as follows:(9)xt=xt−1+Stsinθt,(10)yt=yt−1+Stsinθt,(11)ft=ft−1−Pt−Pt−1Pdiffa,b,where xt and yt are the user coordinates at floor ft at time t and St is the corresponding step length and θt the heading direction. Pt and Pt−1 are the air pressure values at time t and t−1, respectively. And Pdiffa,b is the air pressure difference between floor a and floor b. Adding the threshold values for both step detection and direction heading will ensure values and of course a robust position when these landmarks are added later to the localization map
(4)
While the PDR is conducted to estimate the location of the user, the measurements from the barometer, gyroscope, and accelerometer are simultaneously used to detect landmarks. Although both the gyroscope readings and compass readings (inferred from accelerometer readings and magnetometer readings) can be used to estimate the heading, they cannot provide a robust heading estimation since the gyroscope has the drift problem and the compass is vulnerable to ferromagnetic materials [39]. Therefore, the landmark graph is used to assist with the heading direction estimation. If a user is detected to walk on the path connecting two landmarks in the landmark graph, the heading from this landmark graph will be used. Otherwise, the compass readings will be used as the heading. Also, the step size is updated when a user passes two neighbouring landmarks in the landmark graph. Let l1 and l2 indicate the two neighbour landmarks that a user passes subsequently. Given the x,y coordinates of each of these landmarks, and the number NS of detected steps between them; then the step size S can be calculated as follows:
(12)S=Xl1−Xl22+Yl1−Yl22NSThe step size estimation method does not require the user’s stature information and can adapt to varying walking speeds, and it is updated as the user passes two neighbour landmarks on the landmark graph.Using landmarks for assisting localization may result in a need to solve the data association issue [40], in other words, when there are multiple landmarks nearby, or when there is a case that one or more landmarks are missed from sensor data, or mainly it can be used to avoid false detections.We need to have a measure of how much confidence a location points meeting the landmark detection rule. The confidence that a location point is matching should be constrained by the following facts; first, the detected landmark should be a valid detection for one of the landmark types; second, it has to fall within the same moving direction; in other words, there should be somehow a path between the estimated landmark at a specific time and the landmark at an earlier time; third, it has to have an acceptable distance from the previous detection. Formally, letlk be a landmark then the confidence conlk in the landmark graph can be calculated as
(13)conlk=δRk,Rt∗·rθk,θt∗·gdk,dt∗,where k is the index of a landmark in the landmark graph, Rk is the detection rule of the reference landmark lk, and Rt∗ is the type of the detected landmark at time t; then δRk,Rt∗ is the validity function of the detected landmark, with δ as the Dirac delta function that is denoted as
(14)δRk,Rt∗=1,ifRk=Rt∗,0,otherwise.From (13), where θk and θt∗ are the reference heading and the estimated heading from the time visiting the last landmark to time t. Then, the path validity r is the rectangle function adopted from our earlier work [14] and can be described as
(15)rθk,θt∗=1,ifθk−θt∗<βθ,0,otherwise,where βθ is a heading direction threshold, when dk and dt∗ are the reference distance and the traveled distance from the last landmark to the location point. Then the distance weight function g is defined as
(16)gdk,dt∗=1dk−dt∗.Once every landmark is being associated with a confidence level, then, when multiple landmarks are nearby, the one with the highest confidence factor will be selected. Moreover, fake landmarks may occur due to user unpredictable actions, for instance making a turn in the middle of the corridor, which may be resulting in detection of a gyroscope landmark. To solve this issue, a confidence thresholdβcon value may be used as such as
(17)lk:conlk≥βcon,∀lk:x,yt.In some other cases, when landmarks are missed from sensor data, for instance, certain landmarks at the locations of doors can be missed if a door is left open since “walking→steady→walking” behaviour pattern will not be detected. In such a case, we have no option but to ignore the underlined landmark, which may result in increasing the accumulation error. But this error will be reduced back when the next landmark is detected since after the addition of every landmark the graph will be denser, having more nodes and, definitely, more connective paths, which will result in reducing the chance of error for the upcoming detections.


## 5. Construction of Fingerprint Map

### 5.1. Quality of Location Fixes of RPs

The construction of a fingerprint map is one essential step towards fine position estimation. Therefore, any location fix is subject to quality check before being matched to any fingerprint and added to the fingerprint map. As explained in the earlier section, the PDR method consists of two components:step size estimation and heading direction estimation. So, a robust algorithm will tend to bind the accumulative error of these two components. In [41], it has been proved that the step periodicity for the same motion state (e.g., walking and jogging) suffers from small variation when a user moves at a relatively constant speed. However, this will significantly vary when a user remains stationary (steady) while using the smartphone arbitrarily, for texting, playing phone games, etc. Therefore, limiting the step periodicity to a certain interval will reduce the location estimation error. The step periodicity can be defined as the period of one step, which is equal to the time difference between two neighbour peaks of the accelerometer measurements as shown in Figure 3. Let PS denote a path segment connecting two neighbour landmarks with N steps in between and N+1 RPs.
(18)PS=ti,xi,yi,fi,∀i=1,2,⋯,N+1,where xi and yi are the coordinates of RPi at time ti with corresponding floor information fi. And let T=T1,⋯,TN indicate the step periodicity set measured by the accelerometer for these N steps. Then the quality belief of path segment PS going through those RP can be evaluated as
(19)belPS=∑i=1NXTi·Ti∑i=1NTi·1σT∗,T∗⊆T,∀Tmin≤T≤Tmax,where the first term indicates the ratio of valid steps with respect to the total number of steps after outliering false walks or frequent stops. The outliering step is carried out using the identifier function XTi, which is defined as
(20)XTi=1,ifTi∈Tmin,Tmax,0,otherwise.The second term is reciprocal of the standard deviation of the valid time setT∗, which includes the valid walks only after outliering the fake walks. In this case, if the user walks with constant speed, then the deviation will be too small. Finally, the belief value belPS of the path segment PS is compared to a certain threshold βbelPS, and the location fix is considered accurate and reliable to be matched with and then added to the fingerprint map.


### 5.2. Fingerprint Matching and Construction of Fingerprint Map

It is necessary to evaluate the estimated location fix quality before using fingerprint matching. Because the accuracy of the RPs’ location fix estimation has a direct impact on the accuracy of the construction of the fingerprint map.Now, letTr denote the trajectory that the user has traveled, including K path segments, which are divided by landmarks, namely, Tr=T1,⋯,TK. And the set of fingerprints collected along this trajectory FP=fp1,⋯,fpN, where N is the number of Wi-Fi scans, each fingerprint contains the RSS and the MAC address of its corresponding RP, since the time when a walk state event happens may be different from the time when the WiFi scan is conducted. Synchronizing the time to conduct the Wi-Fi scan with the time the walk event happens is necessary in order to match the fingerprint with the estimated location fixes. Suppose that the Wi-Fi scan at time tj happens during the time period the user walks from the location xk−1,yk−1 to xk,yk, namely, tk−1≤tj≤tk; then we can estimate the location of the jth potential location fix RPs by using a linear interpolation:
(21)xj=xk−1+xk−xk−1·tj−tk−1tk−tk−1,(22)yj=yk−1+yk−yk−1·tj−tk−1tk−tk−1.According to the calculated locationxj,yj, then the path segment PSi can be found, such that it includes the location xj,yj,fj. After this, we evaluate the quality of PSi, where only when the belPSi meets the threshold requirement—it is essential to evaluate the quality since this will affect the map construction, and therefore, will affect the localization process—later on, the fingerprint is matched with the corresponding location fix and then is added to the fingerprint map in term of RSSj, MACAPj, and its corresponding location xj,yj,fj. This process is recursively done until all the elements in the FP set are used. A summary of the process is shown in Algorithm 1.Algorithm 1: Location Fixing and Fingerprint Matching.
LFFM algorithm
Input:
initila locationX0,Y0,f0
TrajectoryTr=T1,⋯,Tk
vector of
FP=RSS1,MACAP11,RSS2,MACAP22,⋯,RSSi,MACAPiN
Output:
Fingerprint Map
for j=1:N do
Compute the locationxj,yj,fj of the j-th potential Location fix;
Search for thePSi that includes location xj,yj,fj
Compute the beliefbelPSi of PSi
if belPSi>βbel then
Match the fingerprintPFj and the corresponding location xj,yj,fj
Add the tuplexj,yj,fjFPj to the fingerprint map;
end if
end for


## 5.1. Quality of Location Fixes of RPs

The construction of a fingerprint map is one essential step towards fine position estimation. Therefore, any location fix is subject to quality check before being matched to any fingerprint and added to the fingerprint map. As explained in the earlier section, the PDR method consists of two components:step size estimation and heading direction estimation. So, a robust algorithm will tend to bind the accumulative error of these two components. In [41], it has been proved that the step periodicity for the same motion state (e.g., walking and jogging) suffers from small variation when a user moves at a relatively constant speed. However, this will significantly vary when a user remains stationary (steady) while using the smartphone arbitrarily, for texting, playing phone games, etc. Therefore, limiting the step periodicity to a certain interval will reduce the location estimation error. The step periodicity can be defined as the period of one step, which is equal to the time difference between two neighbour peaks of the accelerometer measurements as shown in Figure 3. Let PS denote a path segment connecting two neighbour landmarks with N steps in between and N+1 RPs.
(18)PS=ti,xi,yi,fi,∀i=1,2,⋯,N+1,where xi and yi are the coordinates of RPi at time ti with corresponding floor information fi. And let T=T1,⋯,TN indicate the step periodicity set measured by the accelerometer for these N steps. Then the quality belief of path segment PS going through those RP can be evaluated as
(19)belPS=∑i=1NXTi·Ti∑i=1NTi·1σT∗,T∗⊆T,∀Tmin≤T≤Tmax,where the first term indicates the ratio of valid steps with respect to the total number of steps after outliering false walks or frequent stops. The outliering step is carried out using the identifier function XTi, which is defined as
(20)XTi=1,ifTi∈Tmin,Tmax,0,otherwise.The second term is reciprocal of the standard deviation of the valid time setT∗, which includes the valid walks only after outliering the fake walks. In this case, if the user walks with constant speed, then the deviation will be too small. Finally, the belief value belPS of the path segment PS is compared to a certain threshold βbelPS, and the location fix is considered accurate and reliable to be matched with and then added to the fingerprint map.


## 5.2. Fingerprint Matching and Construction of Fingerprint Map

It is necessary to evaluate the estimated location fix quality before using fingerprint matching. Because the accuracy of the RPs’ location fix estimation has a direct impact on the accuracy of the construction of the fingerprint map.Now, letTr denote the trajectory that the user has traveled, including K path segments, which are divided by landmarks, namely, Tr=T1,⋯,TK. And the set of fingerprints collected along this trajectory FP=fp1,⋯,fpN, where N is the number of Wi-Fi scans, each fingerprint contains the RSS and the MAC address of its corresponding RP, since the time when a walk state event happens may be different from the time when the WiFi scan is conducted. Synchronizing the time to conduct the Wi-Fi scan with the time the walk event happens is necessary in order to match the fingerprint with the estimated location fixes. Suppose that the Wi-Fi scan at time tj happens during the time period the user walks from the location xk−1,yk−1 to xk,yk, namely, tk−1≤tj≤tk; then we can estimate the location of the jth potential location fix RPs by using a linear interpolation:
(21)xj=xk−1+xk−xk−1·tj−tk−1tk−tk−1,(22)yj=yk−1+yk−yk−1·tj−tk−1tk−tk−1.According to the calculated locationxj,yj, then the path segment PSi can be found, such that it includes the location xj,yj,fj. After this, we evaluate the quality of PSi, where only when the belPSi meets the threshold requirement—it is essential to evaluate the quality since this will affect the map construction, and therefore, will affect the localization process—later on, the fingerprint is matched with the corresponding location fix and then is added to the fingerprint map in term of RSSj, MACAPj, and its corresponding location xj,yj,fj. This process is recursively done until all the elements in the FP set are used. A summary of the process is shown in Algorithm 1.Algorithm 1: Location Fixing and Fingerprint Matching.
LFFM algorithm
Input:
initila locationX0,Y0,f0
TrajectoryTr=T1,⋯,Tk
vector of
FP=RSS1,MACAP11,RSS2,MACAP22,⋯,RSSi,MACAPiN
Output:
Fingerprint Map
for j=1:N do
Compute the locationxj,yj,fj of the j-th potential Location fix;
Search for thePSi that includes location xj,yj,fj
Compute the beliefbelPSi of PSi
if belPSi>βbel then
Match the fingerprintPFj and the corresponding location xj,yj,fj
Add the tuplexj,yj,fjFPj to the fingerprint map;
end if
end for


## 6. Experiments and Results

The proposed method was evaluated by experiments conducted in a three-story office building. The area of each floor is about 6,750 square meters. The testing path goes through two floors of this building, and its length is about 420 meters as shown in Figure6. The building is made of precast concrete, blockwork, steel structure, aluminium, ceramic tiles, and zinc-coated materials and also offices and classroom furniture, lab equipment (electrical, electronic and mechanical), and it has many other home appliances. Using this environment and the test bed in Figure 6, a set of experiments were carried out to evaluate the proposed method.Figure 6
Experiment test bed layout.The device used in the experiments is a Samsung Galaxy Note 3 smartphone equipped with Wi-Fi, accelerometer, magnetometer, gyroscope, and barometer. An android app was developed to collect the sensor data. A test user walked along the preset path with the phone in hand and clicked on the app to record the measurements of sensors and collect information about location fixes of RPs to evaluate the location accuracy. The data recorded include the MAC address of visible APs and corresponding RSS and readings from the accelerometer, gyroscope, and barometer. The values of parameters used in this work were empirically determined as shown in Table3.Table 3
Parameters of experimental results.
Function
Parameter
Value
Barometer landmark
Pressure thresholdβbar1
0.05 hPa
Pressure thresholdβbar2
0.3 hPa
Accelerometer landmark
Window size
50 samples
Walking-state threshold
2 s
Steady-state threshold
1-5 s
Gyroscope landmark
Window size
10 samples
Gyro thresholdβgyr
1.1 rad/s
PDR
Pressure differencePRdiff
0.45 hPa
Heading thresholdβθ
30o
Confidence thresholdβcon
0.25
Initial step size
0.63 m
Quality evaluation
Step periodicity thresholdTmax
1 s
Step periodicity thresholdTmin
0.4 s
Belief thresholdβS
15The results of LFFM based on the landmark graph for indoor localization method are compared with those of commonly used PDR-I and PDR-II methods in [13] and Map Filtering method in [42]. Both PDR methods used the step-counting approach to estimate the step size; however, to estimate the heading direction, PDR-I used the compass measurements, while PDR-II used the gyroscope measurements, which is almost the same as the sensors used in our work. The cumulative distribution of localization errors shown in Figure 7 shows that our method significantly outperforms the other methods, achieving a mean error of 0.71 meters.Figure 7
Localization accuracy comparison.Another experiment was carried out on a long straight path so that the heading direction could be ignored. This was necessary to evaluate the accuracy of location fixes, where in the first part the user walked along the straight distance with constant speed and in the second part the user walked the same distance with varying speeds and stopped at a few locations to imitate a fake walk status. The localization average error was less than 1 meter in the first part and about 5 meters in the second part.Two different fingerprint maps were created with different belief thresholds introduced; later those maps were fused into the well-known algorithmk-nearest neighbour (kNN)—in the same spirit as in [5]—the localization error of kNN is shown in Figure 8. It can be seen that using the location estimation with high belief belPS>18 to match fingerprints for constructing a radio map achieves much higher accuracy than the one with low belief belPS<10. Therefore, it is necessary to control the quality of location estimation that is used to match fingerprints with location fixes, which has a direct effect on the accuracy of the fingerprinting localization method.Figure 8
Localization error for kNN with different belief thresholds.The best way to evaluate the constructed maps can be done by comparing the localization results using a map constructed using LFFM and another map. In this sense, another comparison was done for fingerprint map construction using the Zee system proposed in [10], and the manual fingerprint map construction technique, despite the huge time cost for constructing the fingerprint map manually, where RSS data has to be collected from a grid of points on the floor map. In this work two various Wi-Fi scans were made, the first with 4 Wi-Fi scans at each grid point, and the second with 10 Wi-Fi scans. These various scans seemed to be necessary to compensate for the orientation of the user, which is a very well-known problem in the fingerprint-based techniques. A total of 300 grid points were placed on the floor with a 2-meter distance interval. The localization errors were compared after fusing the resulting fingerprint maps into the kNN. The positive value fingerprint representation was used [43], namely, positiveifp=RSSi−τ if the ith AP is present in the fingerprint fp and RSSi>τ, where RSSi is the Received Signal Strength from the ith AP and τ is a threshold value (APs whose RSS were lower than the threshold are considered not detected); otherwise, positiveifp=0. The accuracy of applied method is shown in Figure 9.Figure 9
System recognition accuracy at -80 dBm.The effect of RSS threshold usually has a direct effect on the localization accuracy. Figure10 demonstrates that the best performance of all the methods is achieved when the RSS threshold τ was set within [-75, -85] dBm; in our experiments, we have set τ=−80 dBm. A larger or smaller value of τ will lead to an increase in the mean localization error. This is because increasing the RSS threshold may introduce Access Points with very weak signals, which are vulnerable to human movements, and decreasing the RSS threshold would exclude some useful Access Points that can help improve the localization accuracy.Figure 10
Effect of RSS threshold on the mean localization error.


## 7. Conclusion

This paper presented a fast and reliable Location Fixing and Fingerprint Matching to build a fingerprint map based on a landmark graph. Compared to the existing methods, namely ZEE and manual fingerprint map constructions performed in our earlier works, the new method outperforms the manual method and is almost equally as fast as the ZEE method. Moreover, it does not require active user participation; it takes less time and effort and can construct an accurate fingerprint map with the addition of the belief factor.



---

*Source: 7801752-2020-01-17.xml*