02 Activity Recognition
02 Activity Recognition
ABSTRACT
Mobile devices are becoming increasingly sophisticated and the
1. INTRODUCTION
Mobile devices, such as cellular phones and music players, have
latest generation of smart cell phones now incorporates many
recently begun to incorporate diverse and powerful sensors. These
diverse and powerful sensors. These sensors include GPS sensors,
sensors include GPS sensors, audio sensors (i.e., microphones),
vision sensors (i.e., cameras), audio sensors (i.e., microphones),
image sensors (i.e., cameras), light sensors, temperature sensors,
light sensors, temperature sensors, direction sensors (i.e., mag-
direction sensors (i.e., compasses) and acceleration sensors (i.e.,
netic compasses), and acceleration sensors (i.e., accelerometers).
accelerometers). Because of the small size of these “smart” mo-
The availability of these sensors in mass-marketed communica-
bile devices, their substantial computing power, their ability to
tion devices creates exciting new opportunities for data mining
send and receive data, and their nearly ubiquitous use in our soci-
and data mining applications. In this paper we describe and evalu-
ety, these devices open up exciting new areas for data mining
ate a system that uses phone-based accelerometers to perform
research and data mining applications. The goal of our WISDM
activity recognition, a task which involves identifying the physi-
(Wireless Sensor Data Mining) project [19] is to explore the re-
cal activity a user is performing. To implement our system we
search issues related to mining sensor data from these powerful
collected labeled accelerometer data from twenty-nine users as
mobile devices and to build useful applications. In this paper we
they performed daily activities such as walking, jogging, climbing
explore the use of one of these sensors, the accelerometer, in or-
stairs, sitting, and standing, and then aggregated this time series
der to identify the activity that a user is performing—a task we
data into examples that summarize the user activity over 10-
refer to as activity recognition.
second intervals. We then used the resulting training data to in-
duce a predictive model for activity recognition. This work is We have chosen Android-based cell phones as the platform for
significant because the activity recognition model permits us to our WISDM project because the Android operating system is free,
gain useful knowledge about the habits of millions of users pas- open-source, easy to program, and expected to become a domi-
sively—just by having them carry cell phones in their pockets. nant entry in the cell phone marketplace (this is clearly happen-
Our work has a wide range of applications, including automatic ing). Our project currently employs several types of Android
customization of the mobile device’s behavior based upon a phones, including the Nexus One, HTC Hero, and Motorola Back-
user’s activity (e.g., sending calls directly to voicemail if a user is flip. These phones utilize different cellular carriers, although this
jogging) and generating a daily/weekly activity profile to deter- is irrelevant for our purposes since all of the phones can send data
mine if a user (perhaps an obese child) is performing a healthy over the Internet to our server using a standard interface. How-
amount of exercise. ever, much of the data in this work was collected directly from
files stored on the phones via a USB connection, but we expect
Categories and Subject Descriptors this mode of data collection to become much less common in
I.2.6 [Artificial Intelligence]: Learning-induction future work.
All of these Android phones, as well as virtually all new smart
General Terms phones and smart music players, including the iPhone and iPod
Algorithms, Design, Experimentation, Human Factors Touch [2], contain tri-axial accelerometers that measure accelera-
tion in all three spatial dimensions. These accelerometers are also
Keywords capable of detecting the orientation of the device (helped by the
Sensor mining, activity recognition, induction, cell phone, accel- fact that they can detect the direction of Earth’s gravity), which
erometer, sensors can provide useful information for activity recognition. Acceler-
ometers were initially included in these devices to support ad-
Permission to make digital or hard copies of all or part of this work for vanced game play and to enable automatic screen rotation but
personal or classroom use is granted without fee provided that copies are they clearly have many other applications. In fact, there are many
not made or distributed for profit or commercial advantage and that useful applications that can be built if accelerometers can be used
copies bear this notice and the full citation on the first page. To copy to recognize a user’s activity. For example, we can automatically
otherwise, or republish, to post on servers or to redistribute to lists, re-
monitor a user’s activity level and generate daily, weekly, and
quires prior specific permission and/or a fee.
SensorKDD ’10, July 25, 2010, Washington, DC, USA.
monthly activity reports, which could be automatically emailed to
Copyright 2010 ACM 978-1-4503-0224-1…$10.00. the user. These reports would indicate an overall activity level,
10 10
Acceleration
Acceleration
5 5
0 0
-5 X Axis -5
Z Axis
X Axis Z Axis
-10 -10
0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5
Time (s) Time (s)
(a) Walking (b) Jogging
20 20
Y Axis
15 Y Axis
15 Z Axis
10
Acceleration
10
Acceleration
5 Z Axis 5
0 0
-5 -5
X Axis X Axis
-10 -10
0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5
Time (s) Time (s)
(c) Ascending Stairs (d) Descending Stairs
10 10
Y Axis
X Axis
Z Axis
Acceleration
5
Acceleration
Z Axis
0 Y Axis 0
X Axis
-5 -5
0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5
Time (s) Time (s)
(e) Sitting (f) Standing
Actual Class
Walk Jog Up Down Sit Stand Jog 10 1280 31 0 0 96.9
Walk 1513 14 72 82 2 0 Stairs 185 33 784 4 4 77.6
Actual Class
Jog 15 1294 6 6 0 0
Up 277 36 150 77 1 4 earliest studies of this topic, Bao & Intille [3] used five biaxial
accelerometers worn on the user’s right hip, dominant wrist, non-
Down 259 6 136 57 3 4
dominant upper arm, dominant ankle, and non-dominant thigh in
Sit 1 0 4 11 260 6
order to collect data from 20 users. Using decision tables, in-
Stand 3 1 7 3 15 194
stance-based learning, C4.5 and Naïve Bayes classifiers, they
created models to recognize twenty daily activities. Their results
Table 5: Confusion Matrix for Multilayer Perceptron indicated that the accelerometer placed on the thigh was most
Predicted Class powerful for distinguishing between activities. This finding sup-
Walk Jog Up Down Sit Stand ports our decision to have our test subjects carry the phone in the
most convenient location—their pants pocket.
Walk 1543 5 73 60 1 1
Actual Class
Jog 3 1299 16 3 0 0 Other researchers have, like Bao & Intille, used multiple acceler-
Up 84 24 335 98 2 2 ometers for activity recognition. Krishnan et. al. [9] collected data
Down 108 10 136 206 2 3 from three users using two accelerometers to recognize five ac-
Sit 0 2 4 1 268 7 tivities—walking, sitting, standing, running, and lying down. This
Stand 1 0 5 4 8 205 paper claimed that data from a thigh accelerometer was insuffi-
cient for classifying activities such as sitting, lying down, walk-
ing, and running, and thus multiple accelerometers were neces-
The most important activities to analyze are the climbing-up and sary (a claim our research contradicts). In another paper, Krishnan
climbing-down stair activities, since these were the only activities et. al. [10] examined seven lower body activities using data col-
that that were difficult to recognize. The confusion matrices indi- lected from ten subjects wearing three accelerometers. This
cate that many of the prediction errors are due to confusion be- method was tested in supervised and semi-naturalistic settings.
tween these two activities. If we focus on the results for the J48 Tapia et. al. [16] collected data from five accelerometers placed
decision tree model in Table 3, we see that when we are climbing on various body locations for twenty-one users and used this data
up stairs the most common incorrect classification occurs when to implement a real-time system to recognize thirty gymnasium
we predict “downstairs,” which occurs 107 times and accounts for activities. A slight increase in performance was made by incorpo-
a decrease in accuracy of 19.6% (107 errors out of 545). When rating data from a heart monitor in addition to the accelerometer
the actual activity is climbing downstairs, walking slightly out- data. Mannini and Sabitini [23] used five tri-axial accelerometers
paces “upstairs” in terms of the total number of errors (99 vs. 92), attached to the hip, wrist, arm, ankle, and thigh in order to recog-
but this is only because walking occurs more than three times as nize twenty activities from thirteen users. Various learning meth-
often as climbing upstairs in our dataset. If we look at Figures 2a, ods were used to recognize three “postures” (lying, sitting, and
2c, and 2d, we see that the patterns in acceleration data between standing) and five “movements” (walking, stair climbing, run-
“walking”, “ascending stairs” and “descending stairs” are some- ning, and cycling). Foerster and Fahrenberg [28] used data from
what similar. To limit the confusion between the ascending and five accelerometers in one set of experiments and from two of
descending stair activities, we ran another set of experiments those accelerometers in another for activity recognition. Thirty-
where we combine ascending stairs and descending stairs into one one male subjects participated in the study and a hierarchical
activity. The resulting confusion matrix for the J48 algorithm is classification model was built in order to distinguish between
shown in Table 6 (in the interest of space we do not show them postures such as sitting and lying at specific angles, and motions
for the other two algorithms). We see that the results are substan- such as walking and climbing stairs at different speeds.
tially improved, although stair climbing is still the hardest activity
to recognize. Researchers have used a combination of accelerometers and other
sensors to achieve activity recognition. Parkka et. al. [27] created