# Construction of Time-Stamped Mobility Map for Path Tracking via Smith-Waterman Measurement Matching

Authors: Mu Zhou; Zengshan Tian; Kunjie Xu; Haibo Wu; Qiaolin Pu; Xiang Yu
Journal: Mathematical Problems in Engineering
 (2014)

---

## Abstract

Path tracking in wireless and mobile environments is a fundamental technology for ubiquitous location-based services (LBSs). In particular, it is very challenging to develop highly accurate and cost-efficient tracking systems applied to the anonymous areas where the floor plans are not available for security and privacy reasons. This paper proposes a novel path tracking approach for large Wi-Fi areas based on the time-stamped unlabeled mobility map which is constructed from Smith-Waterman received signal strength (RSS) measurement matching. Instead of conventional location fingerprinting, we construct mobility map with the technique of dimension reduction from the raw measurement space into a low-dimensional embedded manifold. The feasibility of our proposed approach is verified by the real-world experiments in the HKUST campus Wi-Fi networks, sMobileNet. The experimental results prove that our approach is adaptive and capable of achieving an adequate precision level in path tracking.


---

## Body

## 1. Introduction

The recent decade has witnessed a growing interest in the location-based applications and services for both indoor and outdoor environments [1–4]. Since the Wi-Fi networks are now widely available, the possibility of tracking people’s motion paths by using the Wi-Fi received signal strength (RSS) allows the ubiquitous context-awareness and several potential innovative services [5]. For instance, if the shoppers’ paths are tracked by the retailers in a store, the sales information and the related advertisements could be pushed in based on the shoppers’ real-time locations [6]. As another example, the hospitals can utilize the patients’ path information to identify whether they are in an emergency situation and also assign the closest doctors or nurses to see the patients, if necessary [7].A variety of wireless network techniques have been considered for location tracking in indoor or outdoor environments. Although the popular and widely used GPS can provide accurate information for outdoor localization and path navigation services, the positioning signals are generally blocked in the indoor or underground scenarios [8, 9]. To solve this problem, the Wi-Fi network is chosen as the favorite technique to achieve indoor localization and tracking due to the popularity in public hotspots and low cost for the deployment in practice [10–13]. In the most recent Wi-Fi localization and tracking approaches, the site-survey measurement on RSS fingerprints is required in the offline phase to construct the RSS radio map associated with the target area [14–18]. However, the adaptation degradation problem occurs due to the time consuming and labor intensive work on fingerprint recording [19]. To solve this problem, Wang et al. in [20] introduced a new idea of mapping the people’s motion paths into a mobility map in which the location points (LPs) are connected by transition relations. As discussed in [20], there are three categories of LPs involved in people’s motion paths: (i) personal common locations (PCLs) which many people have spent a lot of time in, (ii) crucial locations (CLs) where multiple adjacent paths intersect, and (iii) ordinary locations which are used to describe the transition relations between neighboring LPs. Each LP is formed by merging the similar measurements which are recorded from assisted GPS (A-GPS), Wi-Fi, and cellular networks. However, the constructed mobility map in [20] fails to consider the timestamp relations of measurements. In our previous work [21], we found that, for the calculation of measurement similarities, the timestamps and signal strengths are two sides of a coin. With this idea, we performed spectral clustering on RSS shotgun reads based on the combination of timestamps and signal strengths and also refer to Kullback-Leibler divergence of RSS distributions in different LPs to conduct mobility map construction [21]. The most significant problem to limit the practical use for the mobility map in [21] is the low precision and ambiguity in PCL identification, which means that the PCLs cannot be precisely and uniquely identified from the mobility map.To overcome the disadvantages of the conventional approaches, we propose the tracking solution based on the time-stamped mobility map constructed from Wi-Fi RSS measurement matching in this paper. This solution complies with three basic prerequisites: (i) it can be applied to the large anonymous Wi-Fi areas by using physically unlabeled high-dimensional measurements; (ii) mobility map is constructed from significant LPs which are involved in many people’s motion paths; and (iii) people’s motion paths are tracked in an adequate precision level. To meet these goals, we divide our approach into the following four main steps: (i) measurement quantization in a low-dimensional manifold which lies in the raw RSS space, (ii) LP identification by Smith-Waterman measurement matching [22], (iii) LP assembling into the mobility map in a temporal logic manner [23], and (iv) people’s motion path tracking in mobility map.The rest of this paper is organized as follows. Section2 gives an overview of some relevant tracking approaches which have been used so far. In Section 3, we describe the detailed steps involved in our proposed approach. Section 4 presents the experimental results and analysis. Finally, we conclude this paper and provide some future directions in Section 5.


## 2. Related Work

As the Wi-Fi technique becomes prevalent wireless solution in public hotspots, there are a largely increasing number of different approaches used to track people’s paths by using Wi-Fi technique [24, 25]. In general, these approaches fall into five main categories: proximity sensing, location fingerprinting, pattern matching, time trilateration, and angle triangulation.


### 2.1. Proximity Sensing

The proximity sensing is recognized as the simplest way to track people’s locations in a real-time manner [26, 27]. The location calculation is done based on the density of access points (APs) and granularity of divided cells in target area. In most cases, the target is located at the closest cell which it most probably belongs to. In [26], the authors divided the target area into several disjoint cells and fitted the Gaussian RSS distributions for the hearable base stations from the recorded RSSs in each cell. Then, when a localization request arrives, the Bayesian probabilistic method is employed to locate the target into the cell which has the highest confidence probability. Finally, the Markov chain is used for path tracking. As another example of the proximity sensing-based location tracking, the Herecast in [27] conducted the Wi-Fi localization by using a database consisting of the APs’ service set identifiers (SSIDs) and the signal coverage range of each AP. For any location request, the area corresponding to the coverage of the AP which has been detected as the strongest AP, namely, the AP associated with the largest RSS, is referred to as the receiver’s estimated location. Based on this approach, it is extremely difficult to perform a finer path tracking due to the imprecise localization results.


### 2.2. Location Fingerprinting

The location fingerprinting has been most widely used in current location tracking systems in Wi-Fi environments [28–30]. This approach requires the constructed radio map of fingerprints. Each fingerprint is a vector of RSS associated with its physical locations which are calibrated in the offline phase. In the online phase, the target or the location server retrieves the radio map to estimate the location which has the most similar fingerprint to each newly recorded RSS measurement. The first representative RADAR system [28] was designed based on the assumption that the physically adjacent locations have the same fingerprints as in signal space. The operation of RADAR system consists of two phases. The radio map is first constructed in the offline phase to be afterwards used for location estimation. In the online phase, the target’s locations are tracked by using the nearest neighbor(s) in signal space (or K-nearest neighbor(s) (KNN) algorithm). The Horus [30] and Nibble [29] are another two prominent fingerprint-based location tracking systems. Both the Horus and Nibble systems work based on the Bayesian inference approach, while the major difference between them is about the way to depict the RSS distributions at reference points (RPs). In Horus system, a Gaussian distribution curve for each hearable AP is fitted from the recorded RSSs at each RP, while the Nibble system uses a histogram to record the frequencies of recorded RSSs at each RP. Moreover, from the study of the problems about RSS correlation, variations of RSSs with respect to the environmental changes, and relations of RSSs and spatial characteristics, the Horus system is featured with high accuracy and low computation cost compared to the Nibble system.


### 2.3. Pattern Matching

Reference [31] proposed a new location tracking system, LENSR, adopting the K-nearest neighborhood vector mapping-aided topological counter propagation network. Fang and Lin in [32] studied the discriminant-adaptive neural network (DANN) for location tracking in Wi-Fi environment. Different from the conventional pattern matching approaches, DANN extracts the low-dimensional discriminative components for neural network training. Other similar works on pattern matching-based location tracking can be found in [33, 34]. The pattern matching approach addressed in [33] relies on the multilayer perceptron architecture by one-step secant training. In [34], the pattern matching approach with well training process is proved to perform better localization accuracy than the conventional nearest neighbor(s) and Bayesian inference approaches. However, the major drawback of pattern training-based location tracking system is that it should be conducted by sufficient training before it works.


### 2.4. Trilateration and Triangulation

The basic idea of trilateration and triangulation approaches comes from the time of arrival (TOA) and angle of arrival (AOA) measurements. To enable the localization in 2-dimensional areas, the signal measurements from at least three and two APs should be made for the TOA and AOA systems, respectively [35, 36]. In TOA systems [35], the trilateration approach is conducted on the distances between the APs and tracking target which are calculated by the measured propagation time between them. Moreover, the exact time synchronization is also required for the measurement of propagation time. The main advantages of AOA systems [36] are that there are as few as two APs for the purpose of 2-dimensional localization; meanwhile, the time synchronization between the APs and tracking target is not required. However, the location precision could degrade when the signal is blocked by the walls and infrastructures or the target is located far away from the APs.Since the TOA and AOA location systems involve significant changes on hardware devices and infrastructures which make these two systems difficult to be widely applied in practice, the RSS-based trilateration approach is more preferred by current work [37]. Different from the TOA systems, the distances between the APs and tracking target are calculated by the RSS propagation models. In [37], Narzullaev compared three representative models used for Wi-Fi RSS-based trilateration approach: (i) log-distance loss model which assumes that the mean of RSSs approximately decreases logarithmically with the propagation distance, (ii) multislope loss model which achieves a larger granularity of the predicted locations and requires a shorter sample collection time, and (iii) multiwall loss model which carefully takes the path loss caused by the walls and floors into account.In all, applying the aforementioned location tracking approaches into the large Wi-Fi environments could be a challenging work by the reasons of the inaccurate localization results in proximity sensing, laboring cost for fingerprint calibration and training process in location fingerprinting and pattern matching, respectively, and extra devices and infrastructures required by trilateration and triangulation approaches. The main contribution of this paper is to develop a better solution to track people’s motion path in large Wi-Fi environments by using RSS-based time-stamped mobility map without any fingerprint.


## 2.1. Proximity Sensing

The proximity sensing is recognized as the simplest way to track people’s locations in a real-time manner [26, 27]. The location calculation is done based on the density of access points (APs) and granularity of divided cells in target area. In most cases, the target is located at the closest cell which it most probably belongs to. In [26], the authors divided the target area into several disjoint cells and fitted the Gaussian RSS distributions for the hearable base stations from the recorded RSSs in each cell. Then, when a localization request arrives, the Bayesian probabilistic method is employed to locate the target into the cell which has the highest confidence probability. Finally, the Markov chain is used for path tracking. As another example of the proximity sensing-based location tracking, the Herecast in [27] conducted the Wi-Fi localization by using a database consisting of the APs’ service set identifiers (SSIDs) and the signal coverage range of each AP. For any location request, the area corresponding to the coverage of the AP which has been detected as the strongest AP, namely, the AP associated with the largest RSS, is referred to as the receiver’s estimated location. Based on this approach, it is extremely difficult to perform a finer path tracking due to the imprecise localization results.


## 2.2. Location Fingerprinting

The location fingerprinting has been most widely used in current location tracking systems in Wi-Fi environments [28–30]. This approach requires the constructed radio map of fingerprints. Each fingerprint is a vector of RSS associated with its physical locations which are calibrated in the offline phase. In the online phase, the target or the location server retrieves the radio map to estimate the location which has the most similar fingerprint to each newly recorded RSS measurement. The first representative RADAR system [28] was designed based on the assumption that the physically adjacent locations have the same fingerprints as in signal space. The operation of RADAR system consists of two phases. The radio map is first constructed in the offline phase to be afterwards used for location estimation. In the online phase, the target’s locations are tracked by using the nearest neighbor(s) in signal space (or K-nearest neighbor(s) (KNN) algorithm). The Horus [30] and Nibble [29] are another two prominent fingerprint-based location tracking systems. Both the Horus and Nibble systems work based on the Bayesian inference approach, while the major difference between them is about the way to depict the RSS distributions at reference points (RPs). In Horus system, a Gaussian distribution curve for each hearable AP is fitted from the recorded RSSs at each RP, while the Nibble system uses a histogram to record the frequencies of recorded RSSs at each RP. Moreover, from the study of the problems about RSS correlation, variations of RSSs with respect to the environmental changes, and relations of RSSs and spatial characteristics, the Horus system is featured with high accuracy and low computation cost compared to the Nibble system.


## 2.3. Pattern Matching

Reference [31] proposed a new location tracking system, LENSR, adopting the K-nearest neighborhood vector mapping-aided topological counter propagation network. Fang and Lin in [32] studied the discriminant-adaptive neural network (DANN) for location tracking in Wi-Fi environment. Different from the conventional pattern matching approaches, DANN extracts the low-dimensional discriminative components for neural network training. Other similar works on pattern matching-based location tracking can be found in [33, 34]. The pattern matching approach addressed in [33] relies on the multilayer perceptron architecture by one-step secant training. In [34], the pattern matching approach with well training process is proved to perform better localization accuracy than the conventional nearest neighbor(s) and Bayesian inference approaches. However, the major drawback of pattern training-based location tracking system is that it should be conducted by sufficient training before it works.


## 2.4. Trilateration and Triangulation

The basic idea of trilateration and triangulation approaches comes from the time of arrival (TOA) and angle of arrival (AOA) measurements. To enable the localization in 2-dimensional areas, the signal measurements from at least three and two APs should be made for the TOA and AOA systems, respectively [35, 36]. In TOA systems [35], the trilateration approach is conducted on the distances between the APs and tracking target which are calculated by the measured propagation time between them. Moreover, the exact time synchronization is also required for the measurement of propagation time. The main advantages of AOA systems [36] are that there are as few as two APs for the purpose of 2-dimensional localization; meanwhile, the time synchronization between the APs and tracking target is not required. However, the location precision could degrade when the signal is blocked by the walls and infrastructures or the target is located far away from the APs.Since the TOA and AOA location systems involve significant changes on hardware devices and infrastructures which make these two systems difficult to be widely applied in practice, the RSS-based trilateration approach is more preferred by current work [37]. Different from the TOA systems, the distances between the APs and tracking target are calculated by the RSS propagation models. In [37], Narzullaev compared three representative models used for Wi-Fi RSS-based trilateration approach: (i) log-distance loss model which assumes that the mean of RSSs approximately decreases logarithmically with the propagation distance, (ii) multislope loss model which achieves a larger granularity of the predicted locations and requires a shorter sample collection time, and (iii) multiwall loss model which carefully takes the path loss caused by the walls and floors into account.In all, applying the aforementioned location tracking approaches into the large Wi-Fi environments could be a challenging work by the reasons of the inaccurate localization results in proximity sensing, laboring cost for fingerprint calibration and training process in location fingerprinting and pattern matching, respectively, and extra devices and infrastructures required by trilateration and triangulation approaches. The main contribution of this paper is to develop a better solution to track people’s motion path in large Wi-Fi environments by using RSS-based time-stamped mobility map without any fingerprint.


## 3. System Description

### 3.1. System Overview

Our proposed system consists of two phases: offline training phase and online tracking phase, as shown in Figure1. The offline training phase is conducted on the network side with a large amount of computation resource, while the online tracking phase is conducted on the source-weak client side.Figure 1
Architecture of the proposed system.In the offline training phase, we first record RSS measurements to conduct measurement quantization. The quantized RSS measurements are then used to identify the raw LPs by performing the Smith-Waterman measurement matching. Each LP corresponds to a significant location which is involved in many people’s motion paths. Finally, we do the LP assembling to construct the mobility map corresponding to the target area. In the online tracking phase, we first quantize each new RSS measurement into a discrete level. Then, the matching LP with respect to each new online fragment can be determined based on the fine LP matching. Finally, people’s motion paths are tracked by connecting every two consecutive matching LPs along the shortest path in mobility map. For the sake of convenience, a list of notations used in this paper is given in Notation.


### 3.2. RSS Measurement Recording

In our system, the RSS measurements are sporadically recorded by our planned volunteers equipped with Wi-Fi mobile receivers following their routine activities in target area. A measurement is a vector of RSS which consists of the RSS values from all the hearable APs [38]. Each string of consecutive measurements is called a fragment. As discussed in [28, 39], the measurements could be similar if they are recorded at nearby locations. We define the two fragments containing the common similar measurements as a growing fragment pair in which each overlapped piece of common similar measurements forms a raw LP to be afterwards used for LP merging and splitting to construct the time-stamped mobility map.We setR
ℓ
=
{
μ
1
ℓ
,
…
,
μ
N
ℓ
ℓ
} as the ℓth  (
ℓ
=
1
,
…
,
N
) fragment where N and N
ℓ stand for the numbers of fragments and measurement in R
ℓ, respectively, and μ
i
ℓ is the ith  (
i
=
1
,
…
,
N
ℓ
) measurement. If there are M hearable APs, we can obtain μ
i
ℓ
=
(
μ
i
,
1
ℓ
,
…
,
μ
i
,
M
ℓ
), where μ
i
,
j
ℓ
(
j
=
1
,
…
,
M
) is the RSS value from AP j. In each growing fragment pair (i.e., {
R
s
,
R
t
}
(
s
,
t
∈
{
1
,
…
,
N
}
)), the kth (
k
=
1
,
…
,
N
s
,
t
)LP is denoted as P
s
,
t
k. After all the LPs are obtained, the mobility map we seek to construct is recognized as a graph G
=
(
V
P
,
E
P
) in which V
P and E
P stand for the sets of LPs and time-stamped transition relations between neighboring LPs, as previously discussed in [21].


### 3.3. Measurement Quantization

For the sake of applying Smith-Waterman measurement matching technique to construct mobility map, we need to quantize the RSS measurements into different discrete levels based on the similarities of RSS measurements. Specifically, we use Laplacian embedding-based spectral clustering to quantize the RSS measurements which have been merged into the same cluster in the same quantization level. Thus, the number of clusters by spectral clustering equals the number of quantization levels. The detailed steps of measurement quantization process are provided as follows.Step 1.
We calculate the similarity ofμ
i
ℓ and μ
i
′
ℓ
′
(
i
′
=
1
,
…
,
N
ℓ
;
ℓ
′
=
1
,
…
,
N
) as W
i
,
i
′
ℓ
,
ℓ
′ = exp
⁡
(
-
dif
f
R
(
μ
i
ℓ
,
μ
i
′
ℓ
′
)
) where dif
f
R
(
μ
i
ℓ
,
μ
i
′
ℓ
′
)
=
∥
μ
i
ℓ
-
μ
i
′
ℓ
′
∥
2
/
max
⁡
{
∥
μ
i
ℓ
-
μ
i
′
ℓ
′
∥
2
}.Step 2.
Considering the problem of mapping the raw measurements into aK-dimensional (
K
<
M
) space, we can represent the mapped measurements as a (
∑
ℓ
=
1
N
N
ℓ
)
×
K matrix Ψ = [
μ
^
1
1
⋯
μ
^
N
1
1
⋯
μ
^
1
ℓ
⋯
μ
^
N
ℓ
ℓ
⋯
μ
^
1
N
⋯
μ
^
N
N
N
]
T, where the superscript “T” denotes the transpose operation andμ
^
i
ℓ
=
(
r
1
,
i
ℓ
,
…
,
r
K
,
i
ℓ
)denotes the mapped vector of μ
i
ℓ. Based on the Laplacian embedding [40], we can obtain the optimal objective function as
(1)
min
⁡
Ψ
⁡
{
∑
ℓ
,
ℓ
′
=
1
N
∑
i
,
i
′
=
1
N
ℓ
dif
f
R
2
(
μ
^
i
ℓ
,
μ
^
i
′
ℓ
′
)
W
i
,
i
′
ℓ
,
ℓ
′
}
=
min
⁡
Ψ
{
tr
⁡
(
(
Ψ
)
T
(
D
-
W
)
Ψ
)
}
,
where “tr
⁡” denotes the trace operation, D
=
[
D
i
,
i
′
ℓ
,
ℓ
′
]
i
,
i
′
=
1
;
ℓ
,
ℓ
′
=
1
N
ℓ
;
N, and W
=
[
W
i
,
i
′
ℓ
,
ℓ
′
]
i
,
i
′
=
1
;
ℓ
,
ℓ
′
=
1
N
ℓ
;
N. When i
=
i
′ and ℓ
=
ℓ
′, we have D
i
,
i
′
ℓ
,
ℓ
′
=
∑
ℓ
′
=
1
N
∑
i
′
=
1
N
ℓ
′
W
i
,
i
′
ℓ
,
ℓ
′; otherwise, we have D
i
,
i
′
ℓ
,
ℓ
′
=
0. As discussed in [21], the solution to the optimization problem in (1) can be given by the K eigenvectors associated with the smallest eigenvalues of the eigenvalue problem in (2):
(2)
minimize
∑
γ
=
1
K
λ
γ
subject
to
L
μ
^
i
ℓ
=
λ
γ
D
μ
^
i
ℓ
,
i
=
1
,
…
,
N
ℓ
;
ℓ
=
1
,
…
,
N
;
γ
=
1
,
…
,
K
.Step 3.
We performK-means clustering on the mapped K-dimensional vectors to obtain the Φ clusters, C
1
,
…
,
C
Φ, where C
ω denotes the ωth  (
ω
=
1
,
…
,
Φ
) cluster. Then, we quantize the RSS measurements corresponding to the mapped vectors in the same cluster into the same quantization level.


### 3.4. Smith-Waterman Measurement Matching

The objective of Smith-Waterman measurement matching is to identify the raw LPs for the construction of mobility map associated with the target area. To meet this goal, we adopt the Smith-Waterman alignment approach to find the winning paths in the scoring space for each growing fragment pair and then perform measurement matching to identify the raw LPs. The steps of the raw LP identification are as follows.Step 1.
In growing fragment pair{
R
s
,
R
t
}
(
R
s
=
{
μ
1
s
,
…
,
μ
N
s
s
}, R
t
=
{
μ
1
t
,
…
,
μ
N
t
t
}
), when μ
p
s
(
p
∈
{
1
,
…
,
N
s
}
) and μ
q
t
(
q
∈
{
1
,
…
,
N
t
}
) are in the same quantization level, we set a positive matching score, φ
(
μ
p
s
,
μ
q
t
), for the measurement pair (
μ
p
s
,
μ
q
t
); otherwise, we set a negative mismatching score, ψ
(
μ
p
s
,
μ
q
t
), for (
μ
p
s
,
μ
q
t
). The negative missing scores, ϕ
w
(
μ
p
s
,
-
) and ϕ
w
(
-
,
μ
q
t
), are set when there is no measurement in R
t and R
s matched with μ
p
s and μ
q
t, respectively. We have the relations of “matching score >
0
> missing score > mismatching score.” Then, we can obtain the scoring space, H
s
,
t
=
[
H
(
μ
p
s
,
μ
q
t
)
]
p
=
1
;
q
=
1
N
s
;
N
t, for the growing fragment pair {
R
s
,
R
t
}, as shown in the following:(3)
H
s
,
t
=
[
H
(
μ
p
s
,
μ
q
t
)
]
p
=
1
;
q
=
1
N
s
;
N
t
=
[
max
⁡
{
H
(
μ
p
-
1
s
,
μ
q
-
1
t
)
+
φ
(
μ
p
s
,
μ
q
t
)
,
μ
p
s
and
μ
q
t
are
in
the
same
level
;
H
(
μ
p
-
1
s
,
μ
q
-
1
t
)
+
ψ
(
μ
p
s
,
μ
q
t
)
,
μ
p
s
and
μ
q
t
are
in
different
levels
;
max
⁡
w
=
1
p
-
1
{
H
(
μ
p
-
w
s
,
μ
q
t
)
+
ϕ
w
(
μ
p
s
,
-
)
}
;
max
⁡
w
=
1
q
-
1
{
H
(
μ
p
s
,
μ
q
-
w
t
)
+
ϕ
w
(
-
,
μ
q
t
)
}
;
0
}
]
p
=
1
;
q
=
1
N
s
;
N
t
,
H
(
μ
p
′
s
,
μ
0
t
)
=
0
,
p
′
=
1
,
…
,
N
s
,
H
(
μ
0
s
,
μ
q
′
t
)
=
0
,
q
′
=
1
,
…
,
N
t
.Step 2.
We select the measurement pair,(
μ
p
~
s
,
μ
q
~
t
), which has the highest score in scoring space as the first point on the winning path, such that (
μ
p
~
s
,
μ
q
~
t
)
=
arg
ma
x
p
=
1
;
q
=
1
N
s
;
N
t
{
H
(
μ
p
s
,
μ
q
t
)
}. We require that the score of the first point should be higher than η
M (i.e., H
(
μ
p
~
s
,
μ
q
~
t
)
>
η
M), where η
M is the threshold for measurement matching. In our experiments, we set η
M
=
30.Step 3.
We compare the scores of three previous measurement pairs,(
μ
p
~
-
1
s
,
μ
q
~
-
1
t
), (
μ
p
~
-
1
s
,
μ
q
~
t
), and (
μ
p
~
s
,
μ
q
~
-
1
t
), and select the pair which has the highest score among them as the second point on the winning path. We repeat this process until the selected pair has the score zero. At this point, the selected pair with the score zero is defined as the last point on the winning path.Step 4.
After the winning path in scoring space is obtained, we identify the corresponding raw LP by merging the matched measurement pairs. Based on the Smith-Waterman alignment, the three measurement matching criteria are provided as follows.(i)
Criterion 1: measurementsμ
p
s and μ
q
t are matched when there is a diagonal jump from (
μ
p
-
1
s
,
μ
q
-
1
t
) to (
μ
p
s
,
μ
q
t
) in scoring space.
(ii)
Criterion 2: measurementμ
p
s is not matched with any measurement in fragment R
t when there is a top-down jump from (
μ
p
-
1
s
,
μ
q
t
) to (
μ
p
s
,
μ
q
t
) in scoring space.
(iii)
Criterion 3: measurementμ
q
t is not matched with any measurement in fragment R
s when there is a left-right jump from (
μ
p
s
,
μ
q
-
1
t
) to (
μ
p
s
,
μ
q
t
) in scoring space.
To identify the other raw LPs from the scoring space, we continue to select the measurement pair which has the highest score in the remaining measurement pairs which are not involved in the previous winning paths as the first point of a new winning path. We follow Steps3 and 4 until this new winning path arrives at a measurement pair which has the score zero or is involved in the previous winning paths. We name this measurement pair as the last point on this new winning path. For simplicity, we only focus on the situation that only one raw LP exists in a scoring space (i.e., N
s
,
t
=
1 for the growing fragment pair {
R
s
,
R
t
}) since the situation of multiple raw LPs can be avoided by manually chopping each long-length fragment into several shorter ones. The length of a fragment is defined as the number of measurements contained in this fragment.


### 3.5. Mobility Map Construction

After all the raw LPs have been identified, the next work is to assemble the raw LPs into the mobility map in a temporal logic manner. As discussed before, since the measurements in each raw LP are labeled by timestamps, we can approximately represent each raw LP as a time interval which starts at the last point and ends at the first point on its corresponding winning path. Then, the raw LP assembling process can be converted into a temporal reasoning problem, as introduced in [23]. The detailed steps are described below.Step 1.
Based on Allen’s interval algebra (i.e., 13 temporal logic relations:{
=
}, {
m
}, {
mi
}, {
o
}, {
oi
}, {
s
}, {
si
}, {
f
}, {
fi
}, {
d
}, {
di
}, {
<
}, and {
>
}) in [23], we can capture the temporal logic relations between the raw LPs in each growing fragment pair. Specifically, when P
s
,
t
k and P
s
,
t
k
′ are two raw LPs for the growing fragment pair {
R
s
,
R
t
}, we obtain the following:
(4)
(
i
)
if
the
last
point
in
P
s
,
t
k
′
is
located
in
P
s
,
t
k
,
we
have
P
s
,
t
k
{
m
}
P
s
,
t
k
′
;
(
ii
)
if
the
last
point
in
P
s
,
t
k
is
located
in
P
s
,
t
k
′
,
we
have
P
s
,
t
k
{
mi
}
P
s
,
t
k
′
;
(
iii
)
if
the
last
point
in
P
s
,
t
k
′
is
after
the
first
point
in
P
s
,
t
k
,
we
have
P
s
,
t
k
{
<
}
P
s
,
t
k
′
;
(
iv
)
if
the
last
point
in
P
s
,
t
k
is
after
the
first
point
in
P
s
,
t
k
′
,
we
have
P
s
,
t
k
{
>
}
P
s
,
t
k
′
.
In (4), when the timestamp of the last point in a raw LP is larger than the timestamp of the first point of another raw LP, we define “the last point is after the first point”; otherwise, we define “the last point is before the first point.”Step 2.
The temporal logic relations between the raw LPs (i.e.,P
s
,
t
k) and their belonging growing fragment pair (i.e., {
R
s
,
R
t
}) are given as follows:
(5)
(
i
)
if
the
start
point
in
R
s
(
or
R
t
)
is
located
in
P
s
,
t
k
and
the
end
point
in
R
s
(
or
R
t
)
is
after
the
first
point
in
P
s
,
t
k
,
we
have
P
s
,
t
k
{
s
}
R
s
(
or
R
t
)
;
(
ii
)
if
the
start
point
in
R
s
(
or
R
t
)
is
before
the
last
point
in
P
s
,
t
k
and
the
end
point
in
R
s
(
or
R
t
)
is
after
the
first
point
in
P
s
,
t
k
,
we
have
P
s
,
t
k
{
d
}
R
s
(
or
R
t
)
;
(
iii
)
if
the
start
point
in
R
s
(
or
R
t
)
is
before
the
last
point
in
P
s
,
t
k
and
the
end
point
in
R
s
(
or
R
t
)
is
located
in
P
s
,
t
k
,
we
have
P
s
,
t
k
{
f
}
R
s
(
or
R
t
)
;
(
iv
)
if
both
the
start
and
end
points
in
R
s
(
or
R
t
)
are
located
in
P
s
,
t
k
,
we
have
P
s
,
t
k
{
=
}
R
s
(
or
R
t
)
,
where the start and end points in R
s (or R
t) are defined as the measurements which have the smallest and largest timestamps in R
s (or R
t), respectively.Step 3.
Since the mobility map we seek to construct is a connected graph, the temporal logic relations of any two raw LPs can be obtained by Allen’s interval algebra based on the time-stamped transitions between the LPs and fragments. To illustrate this result clearer, we use the transitivity table in [23] to show the temporal logic relations between the different raw LPs. Table 1 gives the possible temporal logic relations between any two LPs (i.e., P
s
,
t
k and P
t
,
u
k
′) belonging to the two different growing fragment pairs (i.e., {
R
s
,
R
t
} and {
R
t
,
R
u
}).
We take the relations ofP
s
,
t
k
{
s
}
R
t and P
t
,
u
k
′
{
s
}
R
t, for instance. Based on the transitivity table, there are three possible temporal logic relations between P
s
,
t
k and P
t
,
u
k
′ (i.e., P
s
,
t
k
{
s
}
P
t
,
u
k
′, P
s
,
t
k
{
si
}
P
t
,
u
k
′, and P
s
,
t
k
{
=
}
P
t
,
u
k
′), such that
(6)
(
i
)
if
the
first
point
in
P
t
,
u
k
′
is
after
the
first
point
in
P
s
,
t
k
,
we
have
P
s
,
t
k
{
s
}
P
t
,
u
k
′
;
(
ii
)
if
the
first
point
in
P
s
,
t
k
is
after
the
first
point
in
P
t
,
u
k
′
,
we
have
P
s
,
t
k
{
si
}
P
t
,
u
k
′
;
(
iii
)
if
the
first
points
in
P
s
,
t
k
and
P
t
,
u
k
′
are
the
same
,
we
have
P
s
,
t
k
{
=
}
P
t
,
u
k
′
.
Finally, the block diagram for the LP assembling into a mobility map is shown in Figure2. We also take the relations of P
s
,
t
k
{
s
}
R
t and P
t
,
u
k
′
{
s
}
R
t, for instance. Based on (6) and Figure 2, (i) if the first points in P
s
,
t
k and P
t
,
u
k
′ are the same (i.e., R
P
(
P
s
,
t
k
,
P
t
,
u
k
′
)
=
{
=
}), we merge P
t
,
u
k
′ into P
s
,
t
k to form a new LP consisting of all the measurement pairs in P
s
,
t
k and P
t
,
u
k
′; (ii) if the first point in P
t
,
u
k
′ is after the first point in P
s
,
t
k (i.e., R
P
(
P
s
,
t
k
,
P
t
,
u
k
′
)
=
{
s
}), we merge all the overlapped measurement pairs in P
t
,
u
k
′ into P
s
,
t
k and then delete all the overlapped measurement pairs in P
t
,
u
k
′; and (iii) if the first point in P
s
,
t
k is after the first point in P
t
,
u
k
′ (i.e., R
P
(
P
s
,
t
k
,
P
t
,
u
k
′
)
=
{
si
}), we merge all the overlapped measurement pairs in P
s
,
t
k into P
t
,
u
k
′ and then delete all the overlapped measurement pairs in P
s
,
t
k.Table 1
Transitivity table for different growing fragment pairs.
R
p
(
P
s
,
t
k
,
P
t
,
u
k
′
)
P
t
,
u
k
′
{
s
}
R
t
P
t
,
u
k
′
{
d
}
R
t
P
t
,
u
k
′
{
f
}
R
t
P
t
,
u
k
′
{
=
}
R
t
P
s
,
t
k
{
s
}
R
t
{
s
,
si
,
=
}
{
<
,
o
,
m
,
di
,
fi
}
{
<
,
o
,
m
}
{
s
}
P
s
,
t
k
{
d
}
R
t
{
>
,
oi
,
mi
,
d
,
f
}
No-info
{
<
,
o
,
m
,
d
,
s
}
{
d
}
P
s
,
t
k
{
f
}
R
t
{
>
,
oi
,
mi
}
{
>
,
oi
,
mi
,
di
,
si
}
{
<
,
o
,
m
,
d
,
s
}
{
f
}
P
s
,
t
k
{
=
}
R
t
{si}
{di}
{fi}
{=}
“No-info” means that all the temporal logic relations are applied.Figure 2
Block diagram for the LP assembling into a mobility map.


### 3.6. Path Tracking in Mobility Map

There are two main steps involved in path tracking: (i) coarse RSS quantization and (ii) fine LP matching. The path tracking in mobility map is conducted as follows.Step 1 (coarse RSS quantization).
As discussed in Section3.2, after the offline RSS measurement quantization, we can obtain Φ clusters associated with the Φ quantization levels. Then, for each new measurement, μ
τ
New
(
τ
=
1
,
…
,
N
New
), in the online fragment, R
New
=
{
μ
1
New
,
…
,
μ
N
New
New
}, where N
New is the number of new measurements in R
New, we calculate the Euclidean distance between μ
τ
New and the average measurement in each cluster (i.e., Avg
(
C
ω
)
(
ω
=
1
,
…
,
Φ
)), dif
f
R
(
μ
τ
New
,
Avg
(
C
ω
)
), and then quantize the new measurement in a discrete level of cluster C
ω
^, such that
(7)
ω
^
=
arg
min
⁡
ω
=
1
,
…
,
Φ
⁡
{
dif
f
R
(
μ
τ
New
,
Avg
(
C
ω
)
)
}
.Step 2 (fine LP matching).
We select the fragment which has the longest length in each LP as the labeling fragment. The labeling fragment inC
ω is denoted as R
ω
ℓ
=
{
μ
1
ℓ
,
…
,
μ
N
ω
ℓ
ℓ
}, where N
ω
ℓ is the number of measurements contained in R
ω
ℓ. When the labeling fragment R
ω
*
ℓ satisfies the relation of
(8)
(
ω
*
,
τ
*
)
=
arg
max
⁡
ω
=
1
,
…
,
Φ
;
τ
=
1
,
…
,
N
New
⁡
{
max
⁡
υ
=
1
,
…
,
N
ω
ℓ
{
H
(
μ
υ
ℓ
,
μ
τ
New
)
}
}
,
we set C
ω
* as the matching LP. After that, all the new measurements before μ
τ
*
New (or the new measurements with IDs not larger than τ
*) are deleted to form a new online fragment (i.e., R
New
←
R
New
∖
{
μ
τ
′
New
(
τ
′
≤
τ
*
)
}) and then continue to search for the next matching LP. We repeat this process until there is no new measurement which remains in the online fragment or the score for the newly formed fragment is lower than the threshold, ε
S. In our experiments, we set ε
S
=
10. After all the matching LPs are obtained, we track the people’s motion paths by connecting every two consecutive matching LPs along the shortest path in mobility map. The shortest path is defined as the path which passes by the smallest number of LPs.
Some of the raw RSS fragments recorded may be very long. When the number of RSS measurements in a fragment is too long, the computation problem may arise for the process of LP assembling into a mobility map, while the main computation cost is involved in the offline training phase. In the online tracking phase, when the user sends a location query with its new RSS fragment, our system retrieves the cluster centers and returns the quantization level as well as the highest score in scoring space. The LP corresponding to the highest score is selected as the matching LP. At this point, the calculation complexity when our system tracks hundreds and thousands of people walking around in the target area forms an interesting work in future. To clearly show the computation cost required in offline training phase, we take the spectral clustering, for example. By using the MATLAB 7.10.0 (R2010a) under WINDOWS XP system, Table2 compares the time cost for spectral clustering in different numbers of measurements conditions. All the computations are run on a PC with Intel Core i3-2120 CPU. In Table 2, we can find that as the number of measurements increases, the time cost for spectral clustering will also increase.Table 2
Time cost for spectral clustering.
Number of measurements
Time cost (second)
Test 1
Test 2
Test 3
100
0.36
0.42
0.41
200
2.25
2.16
2.22
300
7.83
8.28
8.06
400
20.63
20.75
20.62
500
46.49
46.56
46.88
600
111.46
110.02
110.34


## 3.1. System Overview

Our proposed system consists of two phases: offline training phase and online tracking phase, as shown in Figure1. The offline training phase is conducted on the network side with a large amount of computation resource, while the online tracking phase is conducted on the source-weak client side.Figure 1
Architecture of the proposed system.In the offline training phase, we first record RSS measurements to conduct measurement quantization. The quantized RSS measurements are then used to identify the raw LPs by performing the Smith-Waterman measurement matching. Each LP corresponds to a significant location which is involved in many people’s motion paths. Finally, we do the LP assembling to construct the mobility map corresponding to the target area. In the online tracking phase, we first quantize each new RSS measurement into a discrete level. Then, the matching LP with respect to each new online fragment can be determined based on the fine LP matching. Finally, people’s motion paths are tracked by connecting every two consecutive matching LPs along the shortest path in mobility map. For the sake of convenience, a list of notations used in this paper is given in Notation.


## 3.2. RSS Measurement Recording

In our system, the RSS measurements are sporadically recorded by our planned volunteers equipped with Wi-Fi mobile receivers following their routine activities in target area. A measurement is a vector of RSS which consists of the RSS values from all the hearable APs [38]. Each string of consecutive measurements is called a fragment. As discussed in [28, 39], the measurements could be similar if they are recorded at nearby locations. We define the two fragments containing the common similar measurements as a growing fragment pair in which each overlapped piece of common similar measurements forms a raw LP to be afterwards used for LP merging and splitting to construct the time-stamped mobility map.We setR
ℓ
=
{
μ
1
ℓ
,
…
,
μ
N
ℓ
ℓ
} as the ℓth  (
ℓ
=
1
,
…
,
N
) fragment where N and N
ℓ stand for the numbers of fragments and measurement in R
ℓ, respectively, and μ
i
ℓ is the ith  (
i
=
1
,
…
,
N
ℓ
) measurement. If there are M hearable APs, we can obtain μ
i
ℓ
=
(
μ
i
,
1
ℓ
,
…
,
μ
i
,
M
ℓ
), where μ
i
,
j
ℓ
(
j
=
1
,
…
,
M
) is the RSS value from AP j. In each growing fragment pair (i.e., {
R
s
,
R
t
}
(
s
,
t
∈
{
1
,
…
,
N
}
)), the kth (
k
=
1
,
…
,
N
s
,
t
)LP is denoted as P
s
,
t
k. After all the LPs are obtained, the mobility map we seek to construct is recognized as a graph G
=
(
V
P
,
E
P
) in which V
P and E
P stand for the sets of LPs and time-stamped transition relations between neighboring LPs, as previously discussed in [21].


## 3.3. Measurement Quantization

For the sake of applying Smith-Waterman measurement matching technique to construct mobility map, we need to quantize the RSS measurements into different discrete levels based on the similarities of RSS measurements. Specifically, we use Laplacian embedding-based spectral clustering to quantize the RSS measurements which have been merged into the same cluster in the same quantization level. Thus, the number of clusters by spectral clustering equals the number of quantization levels. The detailed steps of measurement quantization process are provided as follows.Step 1.
We calculate the similarity ofμ
i
ℓ and μ
i
′
ℓ
′
(
i
′
=
1
,
…
,
N
ℓ
;
ℓ
′
=
1
,
…
,
N
) as W
i
,
i
′
ℓ
,
ℓ
′ = exp
⁡
(
-
dif
f
R
(
μ
i
ℓ
,
μ
i
′
ℓ
′
)
) where dif
f
R
(
μ
i
ℓ
,
μ
i
′
ℓ
′
)
=
∥
μ
i
ℓ
-
μ
i
′
ℓ
′
∥
2
/
max
⁡
{
∥
μ
i
ℓ
-
μ
i
′
ℓ
′
∥
2
}.Step 2.
Considering the problem of mapping the raw measurements into aK-dimensional (
K
<
M
) space, we can represent the mapped measurements as a (
∑
ℓ
=
1
N
N
ℓ
)
×
K matrix Ψ = [
μ
^
1
1
⋯
μ
^
N
1
1
⋯
μ
^
1
ℓ
⋯
μ
^
N
ℓ
ℓ
⋯
μ
^
1
N
⋯
μ
^
N
N
N
]
T, where the superscript “T” denotes the transpose operation andμ
^
i
ℓ
=
(
r
1
,
i
ℓ
,
…
,
r
K
,
i
ℓ
)denotes the mapped vector of μ
i
ℓ. Based on the Laplacian embedding [40], we can obtain the optimal objective function as
(1)
min
⁡
Ψ
⁡
{
∑
ℓ
,
ℓ
′
=
1
N
∑
i
,
i
′
=
1
N
ℓ
dif
f
R
2
(
μ
^
i
ℓ
,
μ
^
i
′
ℓ
′
)
W
i
,
i
′
ℓ
,
ℓ
′
}
=
min
⁡
Ψ
{
tr
⁡
(
(
Ψ
)
T
(
D
-
W
)
Ψ
)
}
,
where “tr
⁡” denotes the trace operation, D
=
[
D
i
,
i
′
ℓ
,
ℓ
′
]
i
,
i
′
=
1
;
ℓ
,
ℓ
′
=
1
N
ℓ
;
N, and W
=
[
W
i
,
i
′
ℓ
,
ℓ
′
]
i
,
i
′
=
1
;
ℓ
,
ℓ
′
=
1
N
ℓ
;
N. When i
=
i
′ and ℓ
=
ℓ
′, we have D
i
,
i
′
ℓ
,
ℓ
′
=
∑
ℓ
′
=
1
N
∑
i
′
=
1
N
ℓ
′
W
i
,
i
′
ℓ
,
ℓ
′; otherwise, we have D
i
,
i
′
ℓ
,
ℓ
′
=
0. As discussed in [21], the solution to the optimization problem in (1) can be given by the K eigenvectors associated with the smallest eigenvalues of the eigenvalue problem in (2):
(2)
minimize
∑
γ
=
1
K
λ
γ
subject
to
L
μ
^
i
ℓ
=
λ
γ
D
μ
^
i
ℓ
,
i
=
1
,
…
,
N
ℓ
;
ℓ
=
1
,
…
,
N
;
γ
=
1
,
…
,
K
.Step 3.
We performK-means clustering on the mapped K-dimensional vectors to obtain the Φ clusters, C
1
,
…
,
C
Φ, where C
ω denotes the ωth  (
ω
=
1
,
…
,
Φ
) cluster. Then, we quantize the RSS measurements corresponding to the mapped vectors in the same cluster into the same quantization level.


## 3.4. Smith-Waterman Measurement Matching

The objective of Smith-Waterman measurement matching is to identify the raw LPs for the construction of mobility map associated with the target area. To meet this goal, we adopt the Smith-Waterman alignment approach to find the winning paths in the scoring space for each growing fragment pair and then perform measurement matching to identify the raw LPs. The steps of the raw LP identification are as follows.Step 1.
In growing fragment pair{
R
s
,
R
t
}
(
R
s
=
{
μ
1
s
,
…
,
μ
N
s
s
}, R
t
=
{
μ
1
t
,
…
,
μ
N
t
t
}
), when μ
p
s
(
p
∈
{
1
,
…
,
N
s
}
) and μ
q
t
(
q
∈
{
1
,
…
,
N
t
}
) are in the same quantization level, we set a positive matching score, φ
(
μ
p
s
,
μ
q
t
), for the measurement pair (
μ
p
s
,
μ
q
t
); otherwise, we set a negative mismatching score, ψ
(
μ
p
s
,
μ
q
t
), for (
μ
p
s
,
μ
q
t
). The negative missing scores, ϕ
w
(
μ
p
s
,
-
) and ϕ
w
(
-
,
μ
q
t
), are set when there is no measurement in R
t and R
s matched with μ
p
s and μ
q
t, respectively. We have the relations of “matching score >
0
> missing score > mismatching score.” Then, we can obtain the scoring space, H
s
,
t
=
[
H
(
μ
p
s
,
μ
q
t
)
]
p
=
1
;
q
=
1
N
s
;
N
t, for the growing fragment pair {
R
s
,
R
t
}, as shown in the following:(3)
H
s
,
t
=
[
H
(
μ
p
s
,
μ
q
t
)
]
p
=
1
;
q
=
1
N
s
;
N
t
=
[
max
⁡
{
H
(
μ
p
-
1
s
,
μ
q
-
1
t
)
+
φ
(
μ
p
s
,
μ
q
t
)
,
μ
p
s
and
μ
q
t
are
in
the
same
level
;
H
(
μ
p
-
1
s
,
μ
q
-
1
t
)
+
ψ
(
μ
p
s
,
μ
q
t
)
,
μ
p
s
and
μ
q
t
are
in
different
levels
;
max
⁡
w
=
1
p
-
1
{
H
(
μ
p
-
w
s
,
μ
q
t
)
+
ϕ
w
(
μ
p
s
,
-
)
}
;
max
⁡
w
=
1
q
-
1
{
H
(
μ
p
s
,
μ
q
-
w
t
)
+
ϕ
w
(
-
,
μ
q
t
)
}
;
0
}
]
p
=
1
;
q
=
1
N
s
;
N
t
,
H
(
μ
p
′
s
,
μ
0
t
)
=
0
,
p
′
=
1
,
…
,
N
s
,
H
(
μ
0
s
,
μ
q
′
t
)
=
0
,
q
′
=
1
,
…
,
N
t
.Step 2.
We select the measurement pair,(
μ
p
~
s
,
μ
q
~
t
), which has the highest score in scoring space as the first point on the winning path, such that (
μ
p
~
s
,
μ
q
~
t
)
=
arg
ma
x
p
=
1
;
q
=
1
N
s
;
N
t
{
H
(
μ
p
s
,
μ
q
t
)
}. We require that the score of the first point should be higher than η
M (i.e., H
(
μ
p
~
s
,
μ
q
~
t
)
>
η
M), where η
M is the threshold for measurement matching. In our experiments, we set η
M
=
30.Step 3.
We compare the scores of three previous measurement pairs,(
μ
p
~
-
1
s
,
μ
q
~
-
1
t
), (
μ
p
~
-
1
s
,
μ
q
~
t
), and (
μ
p
~
s
,
μ
q
~
-
1
t
), and select the pair which has the highest score among them as the second point on the winning path. We repeat this process until the selected pair has the score zero. At this point, the selected pair with the score zero is defined as the last point on the winning path.Step 4.
After the winning path in scoring space is obtained, we identify the corresponding raw LP by merging the matched measurement pairs. Based on the Smith-Waterman alignment, the three measurement matching criteria are provided as follows.(i)
Criterion 1: measurementsμ
p
s and μ
q
t are matched when there is a diagonal jump from (
μ
p
-
1
s
,
μ
q
-
1
t
) to (
μ
p
s
,
μ
q
t
) in scoring space.
(ii)
Criterion 2: measurementμ
p
s is not matched with any measurement in fragment R
t when there is a top-down jump from (
μ
p
-
1
s
,
μ
q
t
) to (
μ
p
s
,
μ
q
t
) in scoring space.
(iii)
Criterion 3: measurementμ
q
t is not matched with any measurement in fragment R
s when there is a left-right jump from (
μ
p
s
,
μ
q
-
1
t
) to (
μ
p
s
,
μ
q
t
) in scoring space.
To identify the other raw LPs from the scoring space, we continue to select the measurement pair which has the highest score in the remaining measurement pairs which are not involved in the previous winning paths as the first point of a new winning path. We follow Steps3 and 4 until this new winning path arrives at a measurement pair which has the score zero or is involved in the previous winning paths. We name this measurement pair as the last point on this new winning path. For simplicity, we only focus on the situation that only one raw LP exists in a scoring space (i.e., N
s
,
t
=
1 for the growing fragment pair {
R
s
,
R
t
}) since the situation of multiple raw LPs can be avoided by manually chopping each long-length fragment into several shorter ones. The length of a fragment is defined as the number of measurements contained in this fragment.


## 3.5. Mobility Map Construction

After all the raw LPs have been identified, the next work is to assemble the raw LPs into the mobility map in a temporal logic manner. As discussed before, since the measurements in each raw LP are labeled by timestamps, we can approximately represent each raw LP as a time interval which starts at the last point and ends at the first point on its corresponding winning path. Then, the raw LP assembling process can be converted into a temporal reasoning problem, as introduced in [23]. The detailed steps are described below.Step 1.
Based on Allen’s interval algebra (i.e., 13 temporal logic relations:{
=
}, {
m
}, {
mi
}, {
o
}, {
oi
}, {
s
}, {
si
}, {
f
}, {
fi
}, {
d
}, {
di
}, {
<
}, and {
>
}) in [23], we can capture the temporal logic relations between the raw LPs in each growing fragment pair. Specifically, when P
s
,
t
k and P
s
,
t
k
′ are two raw LPs for the growing fragment pair {
R
s
,
R
t
}, we obtain the following:
(4)
(
i
)
if
the
last
point
in
P
s
,
t
k
′
is
located
in
P
s
,
t
k
,
we
have
P
s
,
t
k
{
m
}
P
s
,
t
k
′
;
(
ii
)
if
the
last
point
in
P
s
,
t
k
is
located
in
P
s
,
t
k
′
,
we
have
P
s
,
t
k
{
mi
}
P
s
,
t
k
′
;
(
iii
)
if
the
last
point
in
P
s
,
t
k
′
is
after
the
first
point
in
P
s
,
t
k
,
we
have
P
s
,
t
k
{
<
}
P
s
,
t
k
′
;
(
iv
)
if
the
last
point
in
P
s
,
t
k
is
after
the
first
point
in
P
s
,
t
k
′
,
we
have
P
s
,
t
k
{
>
}
P
s
,
t
k
′
.
In (4), when the timestamp of the last point in a raw LP is larger than the timestamp of the first point of another raw LP, we define “the last point is after the first point”; otherwise, we define “the last point is before the first point.”Step 2.
The temporal logic relations between the raw LPs (i.e.,P
s
,
t
k) and their belonging growing fragment pair (i.e., {
R
s
,
R
t
}) are given as follows:
(5)
(
i
)
if
the
start
point
in
R
s
(
or
R
t
)
is
located
in
P
s
,
t
k
and
the
end
point
in
R
s
(
or
R
t
)
is
after
the
first
point
in
P
s
,
t
k
,
we
have
P
s
,
t
k
{
s
}
R
s
(
or
R
t
)
;
(
ii
)
if
the
start
point
in
R
s
(
or
R
t
)
is
before
the
last
point
in
P
s
,
t
k
and
the
end
point
in
R
s
(
or
R
t
)
is
after
the
first
point
in
P
s
,
t
k
,
we
have
P
s
,
t
k
{
d
}
R
s
(
or
R
t
)
;
(
iii
)
if
the
start
point
in
R
s
(
or
R
t
)
is
before
the
last
point
in
P
s
,
t
k
and
the
end
point
in
R
s
(
or
R
t
)
is
located
in
P
s
,
t
k
,
we
have
P
s
,
t
k
{
f
}
R
s
(
or
R
t
)
;
(
iv
)
if
both
the
start
and
end
points
in
R
s
(
or
R
t
)
are
located
in
P
s
,
t
k
,
we
have
P
s
,
t
k
{
=
}
R
s
(
or
R
t
)
,
where the start and end points in R
s (or R
t) are defined as the measurements which have the smallest and largest timestamps in R
s (or R
t), respectively.Step 3.
Since the mobility map we seek to construct is a connected graph, the temporal logic relations of any two raw LPs can be obtained by Allen’s interval algebra based on the time-stamped transitions between the LPs and fragments. To illustrate this result clearer, we use the transitivity table in [23] to show the temporal logic relations between the different raw LPs. Table 1 gives the possible temporal logic relations between any two LPs (i.e., P
s
,
t
k and P
t
,
u
k
′) belonging to the two different growing fragment pairs (i.e., {
R
s
,
R
t
} and {
R
t
,
R
u
}).
We take the relations ofP
s
,
t
k
{
s
}
R
t and P
t
,
u
k
′
{
s
}
R
t, for instance. Based on the transitivity table, there are three possible temporal logic relations between P
s
,
t
k and P
t
,
u
k
′ (i.e., P
s
,
t
k
{
s
}
P
t
,
u
k
′, P
s
,
t
k
{
si
}
P
t
,
u
k
′, and P
s
,
t
k
{
=
}
P
t
,
u
k
′), such that
(6)
(
i
)
if
the
first
point
in
P
t
,
u
k
′
is
after
the
first
point
in
P
s
,
t
k
,
we
have
P
s
,
t
k
{
s
}
P
t
,
u
k
′
;
(
ii
)
if
the
first
point
in
P
s
,
t
k
is
after
the
first
point
in
P
t
,
u
k
′
,
we
have
P
s
,
t
k
{
si
}
P
t
,
u
k
′
;
(
iii
)
if
the
first
points
in
P
s
,
t
k
and
P
t
,
u
k
′
are
the
same
,
we
have
P
s
,
t
k
{
=
}
P
t
,
u
k
′
.
Finally, the block diagram for the LP assembling into a mobility map is shown in Figure2. We also take the relations of P
s
,
t
k
{
s
}
R
t and P
t
,
u
k
′
{
s
}
R
t, for instance. Based on (6) and Figure 2, (i) if the first points in P
s
,
t
k and P
t
,
u
k
′ are the same (i.e., R
P
(
P
s
,
t
k
,
P
t
,
u
k
′
)
=
{
=
}), we merge P
t
,
u
k
′ into P
s
,
t
k to form a new LP consisting of all the measurement pairs in P
s
,
t
k and P
t
,
u
k
′; (ii) if the first point in P
t
,
u
k
′ is after the first point in P
s
,
t
k (i.e., R
P
(
P
s
,
t
k
,
P
t
,
u
k
′
)
=
{
s
}), we merge all the overlapped measurement pairs in P
t
,
u
k
′ into P
s
,
t
k and then delete all the overlapped measurement pairs in P
t
,
u
k
′; and (iii) if the first point in P
s
,
t
k is after the first point in P
t
,
u
k
′ (i.e., R
P
(
P
s
,
t
k
,
P
t
,
u
k
′
)
=
{
si
}), we merge all the overlapped measurement pairs in P
s
,
t
k into P
t
,
u
k
′ and then delete all the overlapped measurement pairs in P
s
,
t
k.Table 1
Transitivity table for different growing fragment pairs.
R
p
(
P
s
,
t
k
,
P
t
,
u
k
′
)
P
t
,
u
k
′
{
s
}
R
t
P
t
,
u
k
′
{
d
}
R
t
P
t
,
u
k
′
{
f
}
R
t
P
t
,
u
k
′
{
=
}
R
t
P
s
,
t
k
{
s
}
R
t
{
s
,
si
,
=
}
{
<
,
o
,
m
,
di
,
fi
}
{
<
,
o
,
m
}
{
s
}
P
s
,
t
k
{
d
}
R
t
{
>
,
oi
,
mi
,
d
,
f
}
No-info
{
<
,
o
,
m
,
d
,
s
}
{
d
}
P
s
,
t
k
{
f
}
R
t
{
>
,
oi
,
mi
}
{
>
,
oi
,
mi
,
di
,
si
}
{
<
,
o
,
m
,
d
,
s
}
{
f
}
P
s
,
t
k
{
=
}
R
t
{si}
{di}
{fi}
{=}
“No-info” means that all the temporal logic relations are applied.Figure 2
Block diagram for the LP assembling into a mobility map.


## 3.6. Path Tracking in Mobility Map

There are two main steps involved in path tracking: (i) coarse RSS quantization and (ii) fine LP matching. The path tracking in mobility map is conducted as follows.Step 1 (coarse RSS quantization).
As discussed in Section3.2, after the offline RSS measurement quantization, we can obtain Φ clusters associated with the Φ quantization levels. Then, for each new measurement, μ
τ
New
(
τ
=
1
,
…
,
N
New
), in the online fragment, R
New
=
{
μ
1
New
,
…
,
μ
N
New
New
}, where N
New is the number of new measurements in R
New, we calculate the Euclidean distance between μ
τ
New and the average measurement in each cluster (i.e., Avg
(
C
ω
)
(
ω
=
1
,
…
,
Φ
)), dif
f
R
(
μ
τ
New
,
Avg
(
C
ω
)
), and then quantize the new measurement in a discrete level of cluster C
ω
^, such that
(7)
ω
^
=
arg
min
⁡
ω
=
1
,
…
,
Φ
⁡
{
dif
f
R
(
μ
τ
New
,
Avg
(
C
ω
)
)
}
.Step 2 (fine LP matching).
We select the fragment which has the longest length in each LP as the labeling fragment. The labeling fragment inC
ω is denoted as R
ω
ℓ
=
{
μ
1
ℓ
,
…
,
μ
N
ω
ℓ
ℓ
}, where N
ω
ℓ is the number of measurements contained in R
ω
ℓ. When the labeling fragment R
ω
*
ℓ satisfies the relation of
(8)
(
ω
*
,
τ
*
)
=
arg
max
⁡
ω
=
1
,
…
,
Φ
;
τ
=
1
,
…
,
N
New
⁡
{
max
⁡
υ
=
1
,
…
,
N
ω
ℓ
{
H
(
μ
υ
ℓ
,
μ
τ
New
)
}
}
,
we set C
ω
* as the matching LP. After that, all the new measurements before μ
τ
*
New (or the new measurements with IDs not larger than τ
*) are deleted to form a new online fragment (i.e., R
New
←
R
New
∖
{
μ
τ
′
New
(
τ
′
≤
τ
*
)
}) and then continue to search for the next matching LP. We repeat this process until there is no new measurement which remains in the online fragment or the score for the newly formed fragment is lower than the threshold, ε
S. In our experiments, we set ε
S
=
10. After all the matching LPs are obtained, we track the people’s motion paths by connecting every two consecutive matching LPs along the shortest path in mobility map. The shortest path is defined as the path which passes by the smallest number of LPs.
Some of the raw RSS fragments recorded may be very long. When the number of RSS measurements in a fragment is too long, the computation problem may arise for the process of LP assembling into a mobility map, while the main computation cost is involved in the offline training phase. In the online tracking phase, when the user sends a location query with its new RSS fragment, our system retrieves the cluster centers and returns the quantization level as well as the highest score in scoring space. The LP corresponding to the highest score is selected as the matching LP. At this point, the calculation complexity when our system tracks hundreds and thousands of people walking around in the target area forms an interesting work in future. To clearly show the computation cost required in offline training phase, we take the spectral clustering, for example. By using the MATLAB 7.10.0 (R2010a) under WINDOWS XP system, Table2 compares the time cost for spectral clustering in different numbers of measurements conditions. All the computations are run on a PC with Intel Core i3-2120 CPU. In Table 2, we can find that as the number of measurements increases, the time cost for spectral clustering will also increase.Table 2
Time cost for spectral clustering.
Number of measurements
Time cost (second)
Test 1
Test 2
Test 3
100
0.36
0.42
0.41
200
2.25
2.16
2.22
300
7.83
8.28
8.06
400
20.63
20.75
20.62
500
46.49
46.56
46.88
600
111.46
110.02
110.34


## 4. Experimental Results and Analysis

In this section, we will evaluate the performance of mobility map construction and motion path tracking based on the actual RSS fragments (of dimensions 650) recorded on five representative paths in HKUST campus. The five fragments are recorded on path 1,R
1
=
(
R
11
,
R
12
), which is from North Bus Stop to Library and with the length of 191; path 2, R
2
=
(
R
21
,
R
22
,
R
23
,
R
24
), which is from Lab 2149 to Library and with the length of 195; path 3, R
3
=
(
R
31
,
R
32
), which is from Lab 2149 to Coffee Shop and with the length of 85; path 4, R
4
=
(
R
41
,
R
42
), which is from Lab 2149 to Office 2514 and with the length of 106; and path 5, R
5
=
(
R
51
,
R
52
), which is from Lab 2149 to LT-J theater and with the length of 80 [41]. Each path consists of several physically adjacent traces. We take the fragment recorded on path 1 (i.e., R
1), for instance. R
1 contains two consecutive segments, R
11 and R
12, which are recorded on trace 1 (between North Bus Stop and Atrium) and trace 2 (between Atrium and Library), respectively. The traces labeled by superscript “*” (i.e., trace 2, trace 6, and trace 7) are the LPs to be assembled in our testing. The notation “→” indicates the path direction. A summary of these fragments and the corresponding traces is shown in Figure 3.Figure 3
Five fragments recorded on seven traces.First of all, based on the raw measurement space consisting of 657 measurements with dimensions of 650 in Figure4, we can calculate the similarity of any two measurements in Figure 5. The large similarity values (in range of [
0
,
1
]) represent that the corresponding measurement pairs are extremely similar. Moreover, the largest similarity value (or value 1) can be achieved by the similarity between any measurement and itself as expected.Figure 4
Raw measurement space.Figure 5
Similarity between any two measurements.As discussed in Section3.2, the optimization problem in (1) can be converted into the generalized eigenvalue problem in (2). Figure 6 shows the three eigenvectors (of dimensions 657) associated with the K
=
3 smallest eigenvalues. Since the first eigenvector is a constant vector with the eigenvalue zero, we only use the second and third eigenvectors associated with the eigenvalues 0.91 and 0.94, respectively, as the basis of the mapped two-dimensional space. Then, we obtain the 20 clusters (or quantization levels) in the mapped two-dimensional space in Figure 7. For the Smith-Waterman measurement matching, the 20 quantization levels can be recognized as the 20 amino acids. We denote the 20 amino acids as follows: Cys (C), Ser (S), Thr (T), Pro (P), Ala (A), Gly (G), Asn (N), Asp (D), Glu (E), Gln (Q), His (H), Arg (R), Lys (K), Met (M), Ile (I), Leu (L), Val (V), Phe (F), Tyr (Y), and Trp (W) [42]. After that, each RSS fragment can be represented by a string of amino acids, as shown in Table 3.Table 3
Fragment representation by amino acids.
Fragment IDs
Representation
R
1 (with the length of 191)
HHHKKKKKKKIKKKKKKKKKKKKHHHHKKHHHHHHKKIILLIILLDDLLIIKKIIIILLLLDDIIKKIIIIIIIKKKKKHHHHHKKIIDYSLDDLDDLDLILLLIIDDSSSSLLLLIISSDDLLLLDDYYYYSSYYYYCCYYYYCCCCYYSSCCYYYYLLYYCCCCYYYYYYDDDDSSYYSSDDSSLLYYY
R
2 (with the length of 195)
RRAAGGVVQQQQQQPPWWFFWWQQVVPPFFFFEEFFEEEEEEEEEEEEEEEEFFFFEEEEEEEEFFFFWWWWWWPPPPQQQQQQVNNGGGGRAANANNNTTTTTTTTTTTMMMMMMMMMMMMMMMHHHHHHKKIILLDDSSSSSSLICCCCCCCSCCCCCCCCCSCCYYYYCCYYCCYYSSLLDDLLDDDDDDLS
R
3 (with the length of 85)
AARRGGQQQQPPQQPPWWWWPPQQQQWWFFFFFFEEEEEEEEEEEEEEEEEEEEFFFFEEEEEEFFEEEEFFWWWWWWPPPPQQQ
R
4 (with the length of 106)
GGRGGVQQPPQPPPWWWFEEEEFEFFWWPPPPWWPPPQPPPPPPPPPPPPPPPPAAANNAARRAAAAAAAAAARRRRGGGGGGAAAAAAARRRAANNNNNNNNNNN
R
5 (with the length of 80)
RRGVVVQQQQPPPPPWFFFWWVQPWWQWWQQVVGGRRRRRRRAAAAAAAAAAAAAAAAAAAAAAAANNAAAAAAAAAAAAFigure 6
Eigenvectors for the construction of mapped low-dimensional space.Figure 7
Measurement quantization into 20 different levels.Second, after the raw measurements are quantized into 20 discrete levels, we will calculate the winning paths from the scoring space for each growing fragment pair. By settingη
M
=
30, we can obtain four winning paths from the four growing fragment pairs {
R
1
,
R
2
}, {
R
2
,
R
3
}, {
R
3
,
R
4
}, and {
R
3
,
R
5
} in Figure 8. The matching score, missing score, and mismatching score are determined by PAM250 mutation matrix [42]. In Figure 9, the mobility map associated with the target area is constructed by LP assembling. From Figures 3 and 9, the mobility map constructed by LP assembling is extremely similar to the trajectory of the people’s actual motion. Then, the LP assembling is proved to perform well in layout description for the anonymous areas where the floor plans are not available.Winning path in scoring space for each growing fragment pair.
(a)
Fragment pair{
R
1
,
R
2
}
(b)
Fragment pair{
R
2
,
R
3
}
(c)
Fragment pair{
R
3
,
R
4
}
(d)
Fragment pair{
R
3
,
R
5
}Figure 9
Mobility map constructed by LP assembling.Finally, to verify the efficiency of the mobility map constructed by LP assembling further, we use three paths for the testing of path tracking: (i) TP 1= Trace 1→Trace 2 which is the same as path 1, (ii) TP 2 = Trace 2→Trace 3→Trace 6→Trace 7 which is in the opposite direction of path 2, and (iii) TP 3 = Trace 5→Trace 7→Trace 7→Trace 4 which is a combined path from paths 4 and 5. The previous two traces on TP 3 are in the opposite direction of path 5, while the following two traces are the same as path 4. In coarse RSS quantization step, we quantize the new fragments recorded on TP 1, TP 2, and TP 3 (with the lengths of N
New
=
191, 195, and 186) into Φ
=
20discrete levels, as shown in Figure 10.Quantization for the new online fragments.
(a)
New measurement space
(b)
Quantization resultsThen, after the new fragment recorded on each path has been quantized, we conduct the fine LP matching to identify the matching LPs in mobility map. Without loss of generality, all the traces in mobility map (i.e., Traces 1–7) are considered for LP matching in our experiments. Then, the traces with the corresponding labeling fragments which satisfy the relations in (8) are selected as the matching LPs. The results of LP matching for the new online fragments recorded on TP 1, TP 2, and TP 3 are shown in Figures 11, 12, and 13, respectively.LP matching for the new online fragment recorded on TP 1.
(a)
Scoring spaces for the raw new fragment and labeling fragments on different traces
(b)
Scoring spaces for the 1st newly formed fragment and labeling fragments on different tracesLP matching for the new online fragment recorded on TP 2.
(a)
Scoring spaces for the raw new fragment and labeling fragments on the four similar traces
(b)
Scoring spaces for the 1st newly formed fragment and labeling fragments on the four similar tracesLP matching for the new online fragment recorded on TP 3.
(a)
Scoring spaces for the raw new fragment and labeling fragments on the four similar traces
(b)
Scoring spaces for the 1st newly formed fragment and labeling fragments on the four similar traces
(c)
Scoring spaces for the 2nd newly formed fragment and labeling fragments on the four similar tracesIn Figure11(a), we find that the highest score, 61, is captured at the position (74, 104) in scoring space for the raw new fragment and the labeling fragment on Trace 1. Thus, we delete all the new measurements with the IDs not larger than τ
*
=
104 from the raw new fragment to obtain the 1st newly formed fragment (with the measurement IDs from 105 to 191). As can be seen from Figure 11(b), Trace 2 with the highest score, 45.33, to the 1st newly formed fragment is selected as the second matching LP. Since the scores for any traces to the 2nd newly formed fragment are lower than ε
S, we construct the people’s motion path in mobility map as Trace 1→Trace 2 which is the same as the actual motion path, TP 1.Figures12 and 13 show the scoring spaces for the new online fragments recorded on TP 2 and TP 3, respectively, and labeling fragments on the four most similar traces. The four traces which have the highest scores to the new online fragments are defined as the four most similar traces. The scores for the four most similar traces with respect to the new fragments are shown in Table 4.Table 4
Scores for the four most similar traces.
Trace IDs
New fragment IDs
TP 1
TP 2
TP 3
Raw newfragment
1st newfragment
Raw newfragment
1st newfragment
Raw newfragment
1st newfragment
2nd newfragment
Trace 1
61
22
19.33
19.33
/
/
/
Trace 2
45.33
45.33
66.67
28
12
12
/
Trace 3
/
/
/
/
13.67
13.67
13.67
Trace 4
/
/
/
/
/
/
61.67
Trace 5
7
/
/
/
24
21
21
Trace 6
13.33
13.33
38
38
/
/
/
Trace 7
/
6.67
18.67
18.67
22
22
8.33Table5 gives the new online fragments and the corresponding tracking paths which are connected by the matching LPs in mobility map. Therefore, our constructed time-stamped mobility map performs well in people’s motion path tracking, especially for the motion paths which are in the same direction of the raw paths used for mobility map construction. For instance, on TPs 1 and 3, Trace 1→Trace 2 and Trace 7→Trace 4 which are in the same direction of the raw paths 1 and 4 are precisely tracked in mobility map in Figures 11 and 13.Table 5
Path tracking in mobility map.
Actual motion paths
Tracking paths and new online fragments
TP 1(Trace 1→Trace 2)
Tracking path: Trace 1→Trace 2
(i) Raw new fragment with the length of 191(measurement IDs from 1 to 191) (ii) The 1st newly formed fragment with the length of 87 (measurement IDs from 105 to 191)
TP 2(Trace 2→Trace 3→Trace 6→Trace 7)
Tracking path: Trace 2→Trace 6
(i) Raw new fragment with the length of 195(measurement IDs from 1 to 195) (ii) The 1st newly formed fragment with the length of 142 (measurement IDs from 54 to 195)
TP 3(Trace 5→Trace 7→Trace 7→Trace 4)
Tracking path: Trace 5→Trace 7→Trace 4
(i) Raw new fragment with the length of 186(measurement IDs from 1 to 186) (ii) The 1st newly formed fragment with the length of 148 (measurement IDs from 39 to 186) (iii) The 2nd newly formed fragment with the length of 77 (measurement IDs from 110 to 186)


## 5. Conclusions

In this paper, we introduced a novel Wi-Fi RSS measurement matching approach to construct a fine-granularity mobility map for layout description in anonymous areas without location fingerprinting. In our system framework, we first adopt Smith-Waterman alignment approach to obtain the significant LPs from measurement matching in scoring space. Then, Allen’s interval algebra is used to conduct LP assembling into a time-stamped mobility map in temporal logic manner. Our extensive mathematical analysis and experimental results show that our approach can deal with the problems of mobility map construction from sporadically recorded high-dimensional Wi-Fi RSS measurements and people’s motion path tracking in arbitrary directions. We will continue to investigate the integration of time-stamped RSS measurements and motion sensors for the sake of constructing a highly precise mobility map. For instance, the relations of LPs can be described by not only the timestamps, but also the angle and speed measured by the off-the-shelf smartphones.



---

*Source: 673159-2014-03-17.xml*