Walk Compass
Walk Compass
Walking Direction
Nirupam Roy
nroy8@illinois.edu
He Wang
hewang5@illinois.edu
croy@illinois.edu
ABSTRACT
1.
General Terms
Design, Experimentation, Performance
Keywords
Heading direction; Force analysis; Mobile phones; Sensing;
Compass correction; Localization; Activity recognition; Orientation; Magnetic field
Permission to make digital or hard copies of all or part of this work for personal or
classroom use is granted without fee provided that copies are not made or distributed
for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than
ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission
and/or a fee. Request permissions from permissions@acm.org.
MobiSys14, June 1619, 2014, Bretton Woods, New Hampshire, USA.
Copyright 2014 ACM 978-1-4503-2793-0/14/06 ...$15.00.
http://dx.doi.org/10.1145/2594368.2594392 .
INTRODUCTION
2.
(1) Despite substantial research on activity recognition and phone orientations, why is walking direction still an unsolved problem?
While we have been somewhat surprised as well, our literature survey revealed some insights into this question. Most
papers that have attempted this problem have done so in
the context of a broader application, and have leveraged
application-specific opportunities to resolve the challenges.
For instance, [9] analyzes human motion in indoor settings
and inherently requires a map of the place; authors leverage
the same map to estimate the users walking direction. Authors in [30] perform localization using information about
the WiFi APs location, and use the same AP locations
to infer crude walking direction. [22, 19] assumes that the
phones initial orientation is known, and tracks the users
heading direction for a short time window after that. Zee
[28] is one of the localization papers that addresses the problem without other assumptions, but admit that the solution
is not stable and oers ambiguity they mention that using
maps can solve the problem at the expense of some latency.
A recent paper [5] attempts to solve the problem as a
stand-alone module but uses highly controlled conditions
for testing, namely, phone held in hand. MATLAB results
are presented for two path traces from outdoor environments. Moreover, the solution is only in the local coordinate
frame. Finally, several papers estimate the orientation of a
smartphone on the human body. Phone orientation, while
necessary, is insufficient for translating a users walking direction to a global coordinate system; moreover, detecting
the (local) walking direction is a separate problem. Knowing the orientation does not make this problem any easier.
3.
SYSTEM OVERVIEW
Figure 1 shows the key building blocks underlying WalkCompass, and their connections. We describe the flow of
operation here, and expand on the technical details in the
next sections.
Human Walk Analysis (one time)
Video-sensor
co-analysis
Semantically
labeled data
WalkCompass
Gyro. based
Dead Reckoning
Projection to
Horizontal Plane
Time Domain
Filtering
Phone Position
Classifier
Local
Walk
Direction
Sway Detection
& Averaging
Iterative
Triangulation
On Low Freq.
Magnetic
Interference
Cancellation
Global
Walk
Direction
4.
SYSTEM DESIGN
Ampl.&
Primary'Step'
Primary'Step'
&0%&
heel>strike&
20%&
40%&
Leg&pivoted&
Body&advances&
60%&
80%&
100%&
Leg&swings& heel>strike&
toe>o&
stance&phase&
swing&phase&
Figure 3: Accelerometer data from human walking patterns with the smartphone placed in the pocket: (a)
Correlated jerks on all 3 axes on the accelerometer indicating a heel-strike on the ground. (b) The peak
detection algorithm detects the timing of the heel-strikes. (c) The gait cycle of human walk composed of 2
phases: the first 60% between two heel strikes is called the stance, and the next 40% is called the swing.
The maximum amplitude and fluctuation in the acceleration, along all the 3 axes, occurs when the heel of the human strikes the ground. This holds true across all positions
on the body, including hand, backpack, pant pocket, shirt
pocket, etc. only the magnitude of the jerk is dierent
in each of them. This general property serves as a valuable
signal marker an anchor point from which other stages
of the walk can be analyzed. To isolate this heel-strike with
high reliability, we add all the 3 dimensions of the accelerometer signal, and take the signal envelope of this summation,
and pass through a simple peak detection algorithm (Figure
3a and 3b). The outputs of the algorithm are the precise
timings of the peaks.
4.1
Stance&(60%)&
Swing&(40%)&
t1&&&&&t2&&&&&t3&&&&&t4&&&&&t5&&&&&t6&&&&&t7&&&&&t8&&&&&t9&
Accelera;on&
toe>o&
heel>strike&
4.2
4.2.1
Past work has developed classifiers that reliably discriminate the phones location on the body (palm, pant pocket,
swinging hands, etc.). The key technique is to observe the
energy density from acceleration, as well as the magnitude of
peaks during the walk. WalkCompass borrows this classifier
with a few minor adjustments this is not our contribution.
Once the phones location is known, we apply a few minor modifications for the case when the phone is held in
the hand (both palm and swing). Specifically, instead of
summing the (x, y, z) accelerometer signals, we first compute the variation along the gravity dimension (which is
2
N"
Time (sec.)
Figure 5: (a) Magnetic fluctuations in 3 indoor environments far higher than outdoors. (b) Heat map of
magnetic intensity across the entire corridor of a science laboratory. WalkCompass performs evaluation in
these settings.
not necessarily the z axis). The intuition is that the phone
bounces maximally along the gravity, and the HWA module shows that the bounce-peaks are well correlated to the
heel strikes. Thus, once we anchor the accelerometer signal to these bounces (which are symmetric for both legs),
we apply the same segment extraction scheme. Fortunately,
the time point when the legs deceleration is maximum, is
also the time when the upper body is getting stabilized from
full-fledged forward motion. Selecting this time window is
eective for hand-held phones. The case for shirt pockets is
slightly more difficult, since the bounce is softer. Nonetheless, the bounce is still visible among the experiments we
performed (but may be less reliable for a soft walker, or a
child). We leave jacket pockets and bags to future work.
4.3
of this section details this algorithm, called Iterative Magnetic Triangulation (IMT). Several pre-processing steps and
fine-tuning are necessary to make the algorithm generic and
robust to widely varying real-world conditions.
600
50
3000
Tightness Metric
2000
1000
Y Axis
Y Axis
50
0
1000
100
150
200
2000
500
400
300
200
250
3000
1000
500
500
1000
1500
300
100
200
X Axis
300
400
X Axis
500
100
0
100
200
300
400
Angle (degree)
Figure 8: The locus of two interference vectors when iterating over geomagnetic vectors. If the magnitude of
the geomagnetic vector is incorrect then the loci creates (a) an irregular shape, otherwise, (b) the loci creates
a regular ellipse/circle shape. (c) Varying values of tightness with increasing IMT picks G corresponding
to minimum tightness at around 260.
database). Importantly, we find that when the magnitude
of G is erroneous, the locus of the intersection points of
< Ii , Ii+1 , Ii+2 >, computed from all values of , follow
erratic shapes (Figure 8(a)). On the other hand, when the
magnitude of G is close to the correct value, this locus forms
a reasonably closed-formed shape, resembling a circle or an
ellipse (Figure 8(b)). In view of this, IMT checks the shape
of the locus and iteratively reduces the magnitude of G until
the locus forms the expected shape.
Step 4: Picking Tight Intersection Clusters
Ideally, each pair in the inference vector triplet should intersect at the same point. In practice, however, the points
of intersection form a cluster. IMT picks the value of for
which it finds the tightest cluster of intersections. We define
the tightness of a cluster as the sum of all pairs of points
in that cluster.
Step 5: Final Global Walking Direction
Figure 8(c) shows the variation of tightness values for a full
iteration of G for a given vector triplet. IMT finds the
lowest point of this graph (i.e., the minimum value of tightness), and the corresponding G (263 in this example) is
announced as the estimated geomagnetic north. Note that
this can also be used as the new compass output, improving
the inherent quality of the compass. Finally, WalkCompass
compares the local walking direction against this estimated
north, and outputs the global walking direction of the user.
Algorithm 1 presents the pseudo code for the IMT algorithm.
5.
5.1
EVALUATION
Implementation and Methodology
5.2
Performance Results
0.75
0.75
0.75
0.5
compass
w/ turns
w/o turns
0
150 75
0
75 150
Error (degree)
0.25
CDF
CDF
CDF
0.5
0.25
w/ turns
w/o turns
0
150 75
0
75 150
Error (degree)
0.5
0.25
w/ turns
w/o turns
0
150 75
0
75 150
Error (degree)
Figure 10: CDF of WalkCompasss LDE error with and without turns. (a) Phone held in the palm. (b)
Phone carried in the pant pocket. (c) Phone held in swinging arms.
We could not develop a meaningful baseline scheme for
comparison, hence, we use the following. For the palm position in Figure 10(a), we record the orientation of the phone
only when it is pointed in the direction of walking. We
smoothen this data through a low pass filter (as a way of
canceling out periodic perturbations) and plot its error CDF
denoted compass. Evidently, even when the phone is
pointing in the forward direction, and the data smoothened,
the fluctuation is appreciable. Since we could not learn the
phones orientation in Figure 10(b) and (c), we do not plot
the compass data in these two graphs.
Figure 9: (a) WalkCompass screenshot.
code for WalkCompass demo.
(b) QR
15
10
5
0
All U1 U2 U3 U4 U5 U6
20
25
Median
75th Percentile
Error (degree)
20
25
Median
75th Percentile
Error (degree)
Error (degree)
25
15
10
5
0
All U1 U2 U3 U4 U5 U6
20
Median
75th Percentile
15
10
5
0
All U1 U2 U3 U4 U5 U6
150
300
200
100
0
Median
75th Percentile
Estimated
Compass
20
40
Time (sec.)
60
100
0.75
50
0
0
CDF
a 180 turn. This is the worst case behavior, and the graph
shows the time it takes to converge to the actual walking
direction. Evidently, the error decreases at a steady pace
with more number of steps after the turn, and converges at
around 5 or 6 steps. We believe these results are slightly
conservative since the ground truth is assumed to be the
intended direction in which the user is walking, and does
not account for how the user actually walked. WalkCompass
measures each of the micro-deviations the user makes at each
step, and is hence slightly penalized here.
Heading (deg.)
Figure 11: The median and 75th percentile of error per user without turns. Phone carried in (a) palm, (b)
pocket, (c) swinging-hand.
0.5
0.25
10
20
Number of Steps
30
Estimated
Compass
0
150 75
0
75 150
Error (degree)
Heading (deg.)
400
300
200
100
0
0
Estimated
Ground truth
20
40
60
Time (sec.)
300
carpet
w/ shoe
tiles
tiles
w/
shoe
w/o shoe
200
100
0
0
carpet
w/o shoe
20
40
Time (sec.)
60
5.2.1
Error distribution
Figure 17 plots the angle histogram across all traces, comparing IMT and the phones compass against ground truth.
Ideally this plot should have a spike only at 0 , which is the
ground truth. Evidently, the compass measurements scatters around 60 on both sides of 0 , occasionally reaching
up to 90 . The long histogram bar around 25 suggest that
thats the common case error. IMT, in contrast, produces
errors of 10 from the ground truth. Figure 18 shows the
cumulative distribution of absolute error for both IMT and
compass. The curve rises steeply for IMT and its value remains less than 15 for 75% of the traces, whereas the raw
compass is at 37 for the same 75th percentile. The median error of IMT is around 7 , less than a third of compass
error. However, for very high magnetic interference, where
the compass error is more than 50 , the performance of IMT
degrades, although still remaining better than the compass.
Figure 19 compares the median error of IMT and native
compass for each of the 15 places. IMT is consistently half
or one-third of the compass. This is encouraging since even
outside WalkCompass, the techniques from this paper can
be useful in improving the compass app in phones, especially
in magnetic rich places where they are needed most.
5.2.2
0.75
0.75
CDF
CDF
0.5
0.25
0.25
All Users
User 16
0
150 75
0
75 150
Error (degree)
1
CDF
0.5
0.25
All Users
User 16
0
150 75
0
75 150
Error (degree)
90
30
150
60
120
60
30
150
0 180
180
210
330
240
300
270
Compass
IMT
40
30
20
10
0
120
Compass
IMT
20
40
60
80
Error (degree)
Figure 18: Comparing CDF of absolute error between the compass and IMT.
0.75
6.
0.5
a b c d e f g h i j k l mn o
Locations
210
330
240
300
3D WalkCompass: This paper investigates human walking direction on 2D, but we believe that the core techniques
can be scaled to 3D, albeit some additional complexity in
the IMT algorithm. We leave this to future work.
270
7.
RELATED WORK
frequency response of the accelerometer. However, the technique alone is insufficient and leaves an ambiguity between
two opposite directions. It relies on the map for disambiguation.
CDF
0.75
0.5
0.25
Triplet Count
10
20
30
Interval (sec.)
40
40
30
20
10
0
a b c d e f g h i j k l mn o
Locations
Vehicle dynamics: In essence, the analysis of vehicle dynamics using inertial sensors is also related to WalkCompass,
despite dierences in approach and methodology. Some recent papers in this domain have leveraged sensor data from
smartphones to track the movement of vehicles for applications like driver detection [8], driving behavior analysis [15,
31, 10], and estimation of road conditions [23].
8.
CONCLUSION
9.
ACKNOWLEDGMENT
10.
REFERENCES
[6]
[7]
[8]
[9]
[10]
[11]
[12]
[13]
[14]
[15]
[16]
[17]
[18]
[19]
[20]
[21]
[22]
[23]
[24]
[25]
[26]
[27]
[28]
[29]
[30]
[31]
[32]