Beruflich Dokumente
Kultur Dokumente
Hong Lu, Jun Yang, Zhigang Liu, Nicholas D. Lane, Tanzeem Choudhury, Andrew T. Campbell
Dartmouth College, {hong,niclane,campbell}@cs.dartmouth.edu, {tanzeem.choudhury}@dartmouth.edu
Nokia Research Center, {jun.8.yang,zhigang.c.liu}@nokia.com
Abstract 1 Introduction
Supporting continuous sensing applications on mobile Todays mobile phones come equipped with an increas-
phones is challenging because of the resource demands of ing range of sensing, computational, storage and commu-
long-term sensing, inference and communication algorithms. nication resources enabling continuous sensing applications
We present the design, implementation and evaluation of the to emerge across a wide variety of applications areas, such
Jigsaw continuous sensing engine, which balances the per- as, personal healthcare, environmental monitoring and social
formance needs of the application and the resource demands networks. A key challenge of continuous sensing on mo-
of continuous sensing on the phone. Jigsaw comprises a set bile phones is to process raw sensor data from multiple sen-
of sensing pipelines for the accelerometer, microphone and sors (e.g., accelerometer, microphone, GPS, gyroscope, dig-
GPS sensors, which are built in a plug and play manner to ital compass, camera) and compute higher level inferences
support: i) resilient accelerometer data processing, which al- and representations of human activities and context pos-
lows inferences to be robust to different phone hardware, ori- sibly in real-time and communicate these higher level infer-
entation and body positions; ii) smart admission control and ences to the cloud. Early examples of continuous sensing
on-demand processing for the microphone and accelerome- applications for the phone are emerging. UbiFit [7] uses ac-
ter data, which adaptively throttles the depth and sophistica- celerometer data to recognize human activities, monitoring
tion of sensing pipelines when the input data is low quality or the amount of exercise by an individual and using an unob-
uninformative; and iii) adaptive pipeline processing, which trusive ambient display on the phone to encourage appropri-
judiciously triggers power hungry pipeline stages (e.g., sam- ate changes in levels of exercise. PEIR [19] uses inferences
pling the GPS) taking into account the mobility and behav- such as the users transportation modes to produce personal-
ioral patterns of the user to drive down energy costs. We ized environmental impact reports that track how the actions
implement and evaluate Jigsaw on the Nokia N95 and the of individuals affect their exposure and contribution to en-
Apple iPhone, two popular smartphone platforms, to demon- vironmental problems such as carbon emissions. CenceMe
strate its capability to recognize user activities and perform [16] uses the phones accelerometer and microphone to in-
long term GPS tracking in an energy-efficient manner. fer the users activity and social interactions and update their
sensing presence on online social networks such a Facebook
Categories and Subject Descriptors and MySpace.
C.3 [Special-Purpose and Application-Based Sys- Continuous sensing applications require careful resource
tems]: Real-time and embedded systems management in order to facilitate long periods of data col-
lection and processing. For example, data should be able
General Terms to be collected for a complete recharge cycle, while leaving
Algorithms, Design, Human Factors, Performance enough energy for the phone to still operate as a phone
Keywords that is, to make calls, text, read email, surf the web. Mobile
phone sensing also requires that the inferences are robust to
Mobile Phone Sensing, Machine Learning, Activity various mobile phone context. For example, classifiers must
Recognition, Power Management be able to withstand a person placing the phone at different
body positions and cope with a wide variety of noisy sensor
inputs that occur when people use their phones in different
real-world scenarios. Sensors react differently under differ-
Permission to make digital or hard copies of all or part of this work for personal or ent conditions, for example, the microphone is robust to the
classroom use is granted without fee provided that copies are not made or distributed phone being placed at different body positions while the ac-
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
celerometer is not. In addition, each phone sensor has spe-
must be honored. Abstracting with credit is premitted. To copy otherwise, to republish, cific tradeoffs largely based on the nature of the data it sam-
to post on servers or to redistribute to lists, requires prior specific permission and/or a ples. For example, accelerometer data is fairly inexpensive
fee.
SenSys10, November 35, 2010, Zurich, Switzerland. to process, compared to the microphone data which typically
Copyright 2010 ACM 978-1-4503-0344-6/10/11 ...$10.00 has a much higher sampling rate and is computational costly
to analyze. Recently, researchers have been challenged to 2 Design Considerations
build mobile phone sensing systems that are both robust and In this section, we discuss the design considerations that
resource efficient [16, 29]. To date, the majority of mobile underpin the development of Jigsaws sensing, processing,
phone sensing systems are stovepipe solutions which attempt and classification pipelines for three of the most common
to address these challenges but in a very application specific sensors found on mobile phones today; that is, accelerome-
way. ter, microphone and GPS.
In this paper, we present Jigsaw, a continuous sensing en-
gine for mobile phone applications which require continuous 2.1 The Accelerometer Pipeline
monitoring of human activities and context. By developing a The energy cost of sampling the accelerometer is not pro-
reusable sensing engine and proposing application agnostic hibitive and neither is the required computation. The only
techniques, we allow Jigsaw to be both resilient and energy- technical barrier to performing continuous sensing using the
efficient. It uses sensor-specific pipelines that have been de- accelerometer is the robustness of inferences.
signed to cope with the individual challenges presented by Figure 1 demonstrates the difficulty in achieving robust-
each sensor. The techniques we develop are not tied to any ness with accelerometer inferences. In this experiment, the
specific application but are based on studying the specific time series output of an accelerometer-based activity classi-
problems that arise in mobile phone sensors and phone us- fier is shown, which is trained from data collected from a
age patterns. phone carried in the front pocket of a pair of jeans. Initially,
Jigsaw operates entirely on mobile phones and does not the phone is in the users pocket while the person is cycling,
require the use of an external server to perform any part of and the inferences are fairly accurate. Midway through the
its operation. Jigsaw implements the following techniques experiment the user receives a phone call, causing notice-
as part of its continuous sensing engine on the Apple iPhone able but understandable temporary misclassification. After
and Nokia N95: i) resilient accelerometer data processing al- the phone call, the user puts the phone in his backpack. For
lows inferences to be robust to different phone hardware, ori- the remainder of the experiment the classifier performance
entation, and body positions; ii) smart admission control and is significantly degraded. Figure 2 helps explain the result
on-demand processing for the microphone and accelerome- of Figure 1 in more detail. It shows sampling during cy-
ter data adaptively throttle the depth and sophistication of the cling from the accelerometer when the phone is in the users
pipelines when the input data is low quality or uninformative, backpack and front pocket. Note, when the phone is in the
and iii) expensive pipeline stages (e.g., audio activity classifi- backpack the raw data simply captures artifacts of vibration,
cation, sampling from the GPS) are triggered judiciously and while the data from the front pocket clearly shows a cyclic
are adaptive to the human behavioral patterns. More specif- pattern. If a classifier is trained with data from one body
ically, new approaches to calibration of the accelerometer, position, it will struggle to recognize the activity when the
classification of activities that are independent to the position phone is placed in other body positions different from where
of the phone on the body, and filtering of extraneous activi- the training data is sourced.
ties and movements are proposed as part of the accelerometer This experiment demonstrates two distinct types of the
pipeline. The microphone pipeline proposes new approaches robustness problem, one associated with the body position
that drive down the computational cost of sensing and clas- and the other associated with errors that occur during tempo-
sification of sound activities while sacrificing as little accu- rary states, such as, taking the phone out of pocket, which
racy as possible. Techniques embedded in the microphone interrupt an on-going activity (e.g., cycling). We refer to
pipeline reduce redundant classification when the sound type these temporary states as extraneous activities, which we
does not change over certain timescales and short circuits more formally defined as activities driven by user interac-
pipeline computation for common but distinctive classes of tions with the phone that are unimportant to the application
sound that are observed. Finally, we design a smart GPS performance such as texting or making a phone call. De-
pipeline that uses learning techniques and drives the duty cy- spite the large amount of prior work that uses accelerom-
cle taking into account the activity of the user, energy bud- eters for physical activity recognition [5, 11, 23, 24], none
get, and duration over which the application needs to oper- developed techniques to counter extraneous activities, which
ate the pipeline automatically regulates the sampling rate degrade the robustness of inference when performing con-
to minimize the localization error. We believe the flexibil- tinuous sensing on mobile phones. In addition, prior work
ity and adaptability of Jigsaw makes it suitable for a wide does not address pipeline techniques to cope with changing
range of emerging continuous sensing applications for mo- body positions, although some (e.g., [5,16]) researchers have
bile phones. measured the negative effects of changing position.
The remainder of the paper has the following structure. The Jigsaw accelerometer pipeline counters extraneous
Section 2 describes the challenges and related work of ro- activities by recognizing: i) periods of user interaction with
bust and energy-efficient classification using the three sen- the phone, (e.g., a user texting); and ii) transition states such
sors (accelerometer, microphone, and GPS). In Section 3, as standing up or picking up the phone. Jigsaw does not
we describe the Jigsaw architecture and algorithms. Section require the phone to maintain any particular body position
4 provides our prototype implementation. Section 5 presents and inference accuracy remains consistently high even when
a detailed evaluation of the system. Section 6 provides two the body position changes, as discussed in Section 5.1. Jig-
proof-of-concept sensing applications built on top of the Jig- saw addresses this challenge by using i) orientation indepen-
saw engine. And Section 7 concludes. dent features rather than only magnitude that is used in exist-
1 0.4
when the phone is in a backpack and the cycling while the phone is (A) in the
model was trained for a front pocket. pant pocket, (B) in the backpack Figure 3: GPS Power Profiling of N95
ing systems such as [16, 24]; ii) one-time device calibration, ing as little robustness as possible. SoundSense only needs
which can be transparent to the user; and iii) classification to run a single audio classifier in the background whereas
techniques where activities are modeled by splitting them the Jigsaw engine needs to support three pipeline processes
into several sub-classes, each of which is tied to particular in parallel presenting a more demanding low power design
body positions; for example, the same activity class (e.g., cy- environment. The Jigsaw engine reduces the computation of
cling) is partitioned based on body positions (e.g., a class for the microphone pipeline with an admission control and duty
upper body positions and a class for lower body positions). cycle component that regulate the amount of data that enters
Collectively, in a natural way these design techniques allows the microphone pipeline. The duty cycle is on-demand rather
the user to use the phone in natural way because Jigsaw is than fixed, as in previous work [16,29]. Within the sound in-
able to intelligently adapt itself to different context. ference stage of the pipeline two techniques are used: i) early
2.2 The Microphone Pipeline pipeline short-circuiting for common but distinctive classes
The difficulties of continuous sensing with the micro- of sound; and ii) minimizing redundant classification opera-
phone pipeline are due to resource efficiency. The micro- tions when the sound type does not changed.
phone generates data at a much higher sampling rate than 2.3 The GPS Pipeline
other sensors and places a heavy burden on the computa- It is well-known that continuous sensing using GPS is
tional resources of the phone. We demonstrate the high CPU costly in terms of energy consumed due to sampling the
burden of a microphone pipeline by performing an experi- GPS [8, 10, 16]; for example, if we assume that the energy
ment on an Apple iPhone using a relatively low audio sam- budget of GPS is 25% [8] of the phones battery, the GPS
pling rate of 8 kHz. We first perform a baseline measurement can only offer continuous GPS sensing for 2 hours using the
and find the average CPU load when playing a 256kbps AAC Nokia N95. It is possible to lower the sampling rate and in-
music file is 8% with a range of 3-15%. In comparison, the crease battery life to an acceptable level, but this sacrifices
CPU load for signal processing and feature extraction is 6% sensing resolution. At low sampling rates the robustness of
on average. During classification using a Gaussian Mixture the GPS pipeline (i.e., the accuracy of the location estimates)
Models (GMM) classifier, the CPU usage rises to 22%, as- starts to become highly sensitive to the mobility pattern of
suming 10 different sound types are classified. The CPU load the user. Accuracy becomes unpredictable in this case; for
increases as the number of sound classes increase; for exam- example, the error associated with the same low sampling
ple, when 20 different sound classes are supported the CPU rate can vary wildly from person to person depending on
load is 36%. The number of classes supported by a single their respective mobility patterns. Even for the same per-
phone will likely rise as applications become more sophisti- son the error can vary dramatically due to changing mobility
cated or when multiple applications use the Jigsaw engine. pattens during a normal day.
It is clear that these CPU usage numbers are too high for The key technical challenge in performing continuous
a continuous background process which needs to have min- sensing with the GPS pipeline is determining an optimal
imal impact on the primary operations of the mobile phone. schedule of sampling the GPS which minimizes the localiza-
Existing microphone sensing systems [22, 26] avoid CPU tion error when possible. A common approach to this prob-
overhead by relying on remote servers; however, these sys- lem is to attempt to use a static duty cycle [16] or use pre-
tems still can not perform continuous sensing due to the en- computed duty cycles for different situations [28, 29]. How-
ergy burden of data transmission between the phone and the ever, no single duty cycle can be appropriate for all people
cloud. While [16] performs classification on the phone, it and devices, e.g., the best sampling schedule for the GPS for
only detects one kind of sound a single class. The Jig- a graduate student who spends most of the day sitting in a lab
saw microphone pipeline is influenced by our prior work on is very different from a UPS worker who drives around a city
SoundSense [14]. However, SoundSense does not support a all day long. Another common approach is to make the duty
classification pipeline for continuous sensing, rather, it ex- cycle adaptive by making runtime duty cycle schedule [10]
plicitly focuses on the challenge of personalizing a generic based on the sensed GPS data, or, using other sensors such
sound classification algorithm based on monitoring user be- as the accelerometer [1, 18] to trigger GPS sampling when
havior over time. In contrast to SoundSense, the Jigsaw motion is detected. However, these approaches still neglect
microphone pipeline does not attempt to learn new sounds. a number of important aspects that impact a schedule such
Rather, it focuses on reducing the CPU load while sacrific- as the battery budget, hardware differences, or the actual re-
quired timing and duration for location estimates from the
application.
0.8
Precision
Recall
0.6 0.6
0.7
0.4 0.4
0.6
0.2 0.2
0.5
0 20% 40% 60% 80% 100%
Percentage of GMM classification saved(%) 0 0
brushing crowd shower street typing vacuumwashing brushing crowd shower street typing vacuumwashing
Figure 9: Tradeoff between the Figure 10: Precision of Two Types of Figure 11: Recall of Two Types of
Accuracy and Percentage of GMM GMM GMM
Classification Saved
tick 290
ally speaking, the full covariance GMM model slightly out- tick 150
tick 0
performs the diagonal covariance one in both metrics with an
average improvement of 2.98% for precision and 3.47% for 6
1 20
namic than other activity sounds. The pace and intensity of
0 10
key strokes vary greatly even for the same person, making 4 3 2 1
4 3 2 1 Energy Level
4 3 2 1 0
it hard to be characterized accurately by the GMM model. Mobility Level
The model misclassified typing in some cases, for example, Figure 15: Learned Policy at Different Time Ticks
when in fact the phone carried in the pocket or backpack hits
against keys or other objects. vals of the fix duty cycling schemes are {5 s, 1 min, 2 min,
To evaluate the efficiency increase due to the similarity 3 min, 4 min, 5 min, 10 min, 20 min}. The Jigsaw GPS
detector mechanism, we examine the tradeoff between accu- pipeline requires activity inferences as input. Table 10 shows
racy and classification when operations/stages are skipped. It the distribution of activity states in the data set. The most
takes approximately 10 ms to run the 7-activity GMM classi- dominant activity is stationary during the weekdays while
fiers, whereas the similarity measure only requires 0.02 ms to other activities increase during weekends. Although no user
compute. Figure 9 shows the tradeoff between the accuracy rode a bike during the data collection phase, we still observe
and the percentage of GMM classification saved. As the sim- some cycling inferences in the trace due to the misclassifica-
ilarity threshold increases more GMM classification opera- tion of walking or vehicle activities.
tions are skipped and as a result the accuracy of the activity
stationary walking running cycling vehicle
classification is reduced. From the plot it can be observed the weekday 77.3% 10.5% 0.6% 0.4% 11.2%
accuracy tradeoff ranged from 84% when 4% of the GMM weekend 38.1% 37.7% 1.8% 0.1% 22.3%
classification is skipped to 60% when 88% is skipped. Even
when 73% of computationally expensive GMM operations Table 10: Mobility State Distribution in Location Traces
are skipped, the penalty on the accuracy of the activity clas- For comparison purposes, the average location errors of
sification is only 5%. This is an important result that makes all schemes are calculated. Location error is defined as the
low energy microphone pipelines viable. Note that the clas- the mean of euclidian distance between the actual location
sification accuracy drops off quickly when 80% of the oper- from the continuous sampling ground truth and the location
ations are saved due to the overly loose similarity threshold. reported by the different schemes note, we use the same
5.3 GPS Pipeline Results fixed duty cycles reported in [8]. Intuitively, higher sam-
To evaluate the Jigsaw GPS pipeline, we collect traces pling rate schemes consume more energy and have a lower
of activity inferences and traces of GPS coordinates during location error and vice versa. The location error and energy
weekdays and weekends. The activity inference traces are efficiency of different fixed duty cycle schemes are shown
generated by Jigsaws accelerometer pipeline. The location in Figure 12 and Figure 13 for the weekday and week-
traces are recorded using a 1 second GPS sampling inter- end traces, respectively. In the MDP model, the GPS power
val. We compare the Jigsaw MDP based adaptive GPS duty budget is set to 25% of N95 phone battery capacity and the
cycle scheme, an accelerometer augmented GPS duty cycle sensing duration is set to 10 hours. The total energy budget is
scheme, and several fix duty cycle schemes using the traces. discretized into 20 levels and the total duration is discretized
With the accelerometer augmented scheme, the GPS is sam- into 300 time ticks. As discussed in Section 3.3, the action
pled every 10 s when there is movement (i.e., the variance space contains 6 sensing actions with different sensing inter-
of accelerometer samples is over a threshold), and suspend vals, and the state transition matrix of the defined four MDP
sampling when there is no movement. The sampling inter- mobility levels is learned from the motion traces. Figure 15
2000 2000 20
fixed duty cycle fixed duty cycle
1800 1800 Energy left
Jigsaw Jigsaw Mobiliity States
Localization Error (Meter)
Energy Level
1600 acc augmented 1600 acc augmented
Sampling Action
1400 1400
10
1200 1200
1000 1000
800 800
1
Action Motion
600 600 4
400 400 1
6
200 200
0 0 1
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4
Sensing Power (Watt) Sensing Power (Watt) 0 50 100 150 200 250 300
Time Tick
Figure 12: Error vs. Power Tradeoff of Figure 13: Error vs. Power Tradeoff of Figure 14: Jigsaw Emulated on a
Weekday GPS Traces Weekend GPS Traces Weekend Trace