UBICOMP '14 ADJUNCT, SEPTEMBER 13 - 17, 2014, SEATTLE, WA, USA

Room Exit Recognition Using
Mobile Accelerometers andIlluminometers
Tatsuya ISODA
Shuji KUTSUNA
Kyushu Institute of Technology NTT FACILITIES
1-1 Sensui-cho, Tobata,2-13-1 Kitaotsuka,
Kitakyushu-shi
Toyoshima-ku
Fukuoka, 804-8550, JAPANTokyo, 170-0004, JAPANis0tatsu.mail.25@gmail.com
kutsun22@ntt-f.co.jp

Masato KAWANO
Sozo INOUE
Kyushu Institute of Technology NTT FACILITIES
2-13-1 Kitaotsuka,
1-1 Sensui-cho, Tobata,
Toyoshima-ku
Kitakyushu-shi
Tokyo, 170-0004, JAPANFukuoka, 804-8550, JAPANkawano35@ntt-f.co.jp
sozo@mns.kyutech.ac.jp

Abstract
At present, oﬃce entrances and exits are controlled mainly
using RFID tags, such as employee ID cards or admission
cards. When using an RFID tag, the card reader is placedat the entrance and recognition only occurs when entering
the room in most cases. Thus, the information required toenter is only recognized during entry but not whenleaving. In this paper, we propose a method for exit
recognition that uses an illuminometer and anaccelerometer embedded in a mobile sensor, whichassesses the changes in the illuminance and acceleration
data for subjects. We analyze the walking data obtained
from the feature values of the acceleration data and theexit data derived from the feature values of theilluminance. We found that this method achieves 87.60%
of accuracy for exit recognition.

Author Keywords
Permission to make digital or hard copies of all or part of this work forpersonal or classroom use is granted without fee provided that copies are notmade or distributed for profit or commercial advantage and that copies bear
this notice and the full citation on the first page. Copyrights for componentsof this work owned by others than the author(s) must be honored. Abstractingwith 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.
UbiComp ’14, September 13 - 17 2014, Seattle, WA, USA
Copyright is held by the owner/author(s). Publication rights licensed to ACM.
ACM 978-1-4503-3047-3/14/09$15.00.
http://dx.doi.org/10.1145/2638728.2641298

731

Mobile sensors, machine learning, room exit recognition,illuminance data

ACM Classification Keywords
I.1.2 [Verification]: Verification of accuracy

Introduction
Recently, oﬃce entrance systems that use RFID tags andcard readers have become very popular. In such systems,

UBICOMP '14 ADJUNCT, SEPTEMBER 13 - 17, 2014, SEATTLE, WA, USA

however, recognition only occurs during entry and it does
not assume, mainly from cost reason, to recognize whenpeople leave the room. In this study, we propose the useof a mobile sensors to recognize the conditions in a room.
Mobile sensors include various sensors. Using mobilesensors to recognize that a subject is leaving a room could
eliminate the cost of installing unnecessary sensor
equipment in buildings.Obtaining real-time entrance andexit information may allow air conditioning or lighting tobe switched oﬀ to save electricity. In this study, we
propose an exit recognition method that uses anilluminometer and an accelerometer mounted on themobile sensors. Basically, it is assumed that making anexit is impossible when a subject stops moving. Our
method analyzes the walking data obtained from thefeature values of the acceleration data and the exit data
derived from the feature values of the illuminance.
Changes in various conditions may be expected whenleaving a room, thus we evaluate the changes in theilluminance and acceleration data related to the subject.
Figure 1: Method employed towear the mobile sensors

Related WorkThe recent popularity of iPhone or Android mobilesensors has simplified the measurement of humanactivities [1]. In the field of medical services [2], forexample, they can obtain data that are relevant tolifestyle-related diseases, which may be useful for theirprevention [3]. In sport, dancing, and traditional arts, thepatterns in data may be useful for evaluating the learninglevels of subjects [4].

Proposed Method
In this section, we describe the proposed method used todetermine room exits based on an accelerometer and anilluminometer mounted on the mobile sensors such assmartphones.

732

Calculation of feature values
In this section, we describe the methods used to analyze
the illuminance and acceleration sensor data obtained inexperiments. In order to calculate the feature values, wesplit the sensor data into regular time intervals and focus
on each specific segment or time window The featurevalues are calculated for each time window and the time
windows are displaced for each setup time. The setup
time used to displace the time window is called a width
shift . Machine learning is then performed using thefeature values obtained from each sensor.
Machine learning
Training data are required to perform recognition using
machine learning. Thus, the feature values used formachine learning are extracted from the feature values
dataset. Acceleration data are eﬀective for human activity
recognition learning. Thus, our proposed learning method
recognizes whether subjects are walking based on theacceleration feature values whereas leaving is determinedusing the illumination feature values.

Evaluation
In this section, we performed evaluation experiments toassess the accuracy of room exit recognition using an
accelerometer and an illuminometer mounted on themobile sensors.
Data set
We collected sensor data using the mobile sensors toperform the evaluation experiment. In four experimental
environments, five subjects each performed two types ofexperimental patterns three times and 120 data sets werecollected. We also conducted these experiments during
the daytime and the nighttime. Thus, 240 data sets werecollected in total.

WORKSHOP: HASCA

Experimental environment
We selected four places where the local environment
diﬀered to perform the room exit recognition experiments.

Table 1: The outline of thelearning feature values
Patterns
Pattern A
Pattern A
Pattern B

Time(s)
55–65
20–30
57–67

Labelexit
walk insidestay

Total Number
1320
1320
1320

200

Raw data and feature amount of illumination
Exit

50
−100

−500feature

100

150

raw
diffsummax
minminmax
Ftime

020406080100120

sec

Figure 2: Illuminance feature
values of Pattern A in thedaytime500

Raw data and feature amount of illumination
Exit

200
100
−200

−1000feature

300

400

raw
diffsummax
minminmax
Ftime

02040

60

80100

sec

Figure 3: Illuminance feature
values of Pattern B in thedaytime120

Data collection
The subjects performed two experimental patterns, asfollows.
Pattern A: Walking around inside the room (1 min) →Exit (about 5 s) → Walking around outside the room (1min)
Pattern B: Walking around inside the room (1 min) →Pause (about 5 s) → Walking around inside the room (1min)
Data collection method
We used an accelerometer and illuminance data torecognize room exits, where a Google NEXUS5 was usedas the mobile sensors for data collection. A dataacquisition application for Android (Sense-it) was used tocollect the accelerometer and illuminance data. Thesensor data were recorded at intervals of 100 Hz. During
the experiment, the device was worn as shown in Figure 1.
Extraction the feature valuesWe calculated the feature values using the accelerometerand illuminance data. The time window was specified as
every 10 s and the width shift had a 1 s interval. Thefeature values were calculated for every time window. For
the illuminance data, the average value, sum of thediﬀerence, maximum value, minimum value, and thediﬀerence between the maximum and minimum values
were calculated as feature values. The sum of thediﬀerence is the value obtained by subtracting the firstvalue from the last value in a time window. For theacceleration data, because the device attachment is not
fixed, we determine the square root of the sum of thesquares in three axes and calculate the distribution.

733

Extraction of the active sections
We extracted the learning feature values from thecalculated feature values for use in machine learning.
Using the feature values obtained from the experimentwith Pattern A, the feature values of the illuminance data
between 55 s and 65 s that contained exit actions werelabeled and extracted as the exit data. The feature valuesof the acceleration data between 20 s and 30 s that
contained walking inside actions were labeled andextracted as the walking data. Using the feature values
obtained with Pattern B, the feature values of theacceleration data between 57 s and 67 s that contained
pause actions were labeled and extracted as the pause
data. In total, 3960 feature values were acquired. The
numbers of feature data points used for learning eachprocess are shown in Table 1.
Evaluation method
We performed machine learning using the statisticalanalysis software R and assessed the proposed method.
We used a SVM [5] as the classifier. We used thefollowing three types of learning methods to determine thebest feature values for machine learning.
Leave-one-person-out learning: In this learning method,
the feature values were divided among subjects, thus thesubjects used for learning were separate from the subjects
used for testing.
Leave-one-place-out learning: In this learning method, thefeature values were divided among experimental
environments, thus the environments used for learning
were separate from the environments used for testing.
Leave-one-person-and-one-place-out learning: In thislearning method, the feature values were divided amongexperimental environments and subjects, thus theenvironments and subjects used for learning were separate
from the environments and subjects used for testing.

UBICOMP '14 ADJUNCT, SEPTEMBER 13 - 17, 2014, SEATTLE, WA, USA

Table 2: Recognition accuracy
for only walking
correct\prediction
stay
walk
accuracy

stay
544
165

walk
776
2475
76.23[%]

Table 3: Recognition accuracy
for only exits
correct\prediction
except exit
exit
accuracy

except exit
2477
252

exit
163
1068
89.52[%]

Table 4: Recognition accuracy
for walking plus exit
correct\prediction
walk insidestay
exit
accuracy

except exit
1210
1279340

exit
110
41980
87.60[%]

Table 5: Recognition accuracy
for only walking
correct\prediction
staywalkaccuracy

stay553
166

walk
767
2474
76.44[%]

Table 6: Recognition accuracy
for only exits
correct\prediction
except exit
exit
accuracy

except exit
2173
463

exit
467
857
76.52[%]The recognition accuracies for only walking, only exits,
and walking plus exits were derived and evaluated using
each learning method.

ResultThis sections describes the results obtained using theproposed methods.
Feature valuesEach feature value was calculated from the data collected.
The features extracted in each experiment are shown in
Figure 2 and Figure 3, where the graph at the top
represents Pattern A and the graph at the bottom
represents Pattern B.
The raw data for illuminance are expressed as ”raw”, theaverage value is expressed as the ”mean”, the sum of thediﬀerence in the values is expressed as ”diﬀsum”, themaximum value is expressed as ”max”, the minimum value
is expressed as ”min”, and the diﬀerence between themaximum and minimum value is expressed as ”minmax”.
There were great changes in each illuminance featurevalue after exiting with Pattern A, but few changes in theilluminance feature values after exiting with Pattern B.
The graphs of the illuminance feature values show that
diﬀerent results were obtained with various environments,
time zones, subjects, and experimental patterns.
Recognition results obtained by machine learning
Machine learning was performed and the recognition
accuracy was verified based on the learning feature values.
The accuracies of walking, exits, and walking plus exits
were derived using the three learning method. The
formula used to determine the accuracy was as follows.
Accuracy =number of correct predictions
× 100%
total number of feature values
(1)

734

Results obtained using leave-one-person-out learning
Table 2 show that the recognition accuracy for only
walking was 76.23%, Table3 show that for only exits was89.52%, and Table 4 show that for walking plus exit was87.60%. Thus, more accurate results were obtained than
the accurate results of leave-one-place-out learning andleave-one-person-and-one-place-out learning.
Results obtained using leave-one-place-out learningTable 5 show that the recognition accuracy for onlywalking was 76.44%, Table 6 show that for only exits was76.52%, and Table 7 show that for walking plus exits was76.74%.
Result obtained using leave-one-person-and-one-place-out
learning
Table 8 show that the recognition accuracy for only
walking was 75.86%, Table 9 that for only exits was75.88%, and Table 10 that for walking plus exits was76.26%. Thus, the accuracies of leave-one-place-out
learning and leave-one-person-and-one-place-out learning
were similar.

Discussion
In this section, we consider the results obtained usingeach method and future research. We tested threelearning methods for recognizing walking, exits, andwalking plus exits. We determined the recognition
accuracy for walking and exits using our proposed
methods. Slightly better recognition results were obtainedusing walking plus exits compared with the recognition
method using only walking and only exits based onleave-one-place-out learning andleave-one-person-and-one-place-out learning. The
recognition accuracy with walking only was the lowest
with all methods. When the walking recognition accuracy

WORKSHOP: HASCA

Table 7: Recognition accuracy
for walking plus exit
correct\prediction
walk insidestay
exit
accuracy

except exit
10931157531

exit
227
16378976.74[%]

Table 8: Recognition accuracy
for only walking
correct\prediction
staywalkaccuracy

stay
544
180

walk7762460
75.86[%]

Table 9: Recognition accuracy
for only exits
correct\prediction
except exit
exit
accuracy

except exit
2156
471

exit
484
849
75.88[%]

Table 10: Recognition accuracy
for walking plus exit
correct\prediction
walk inside
stay
exit
accuracy

except exit
1079
1155534

exit
241
165
786
76.26[%]

was low, the recognition accuracy was aﬀected for walking
plus exits and the overall accuracy was reduced.

we will also recognize room exits in real time.

Acknowledgement
We consider that the recognition accuracy for walking plus
exits was not improved greatly because of the low walking
recognition accuracy. Thus, we must consider the feature
values obtained from the acceleration sensor, the width
shift value, and the time window value in future research.
Leave-one-place-out learning andleave-one-person-and-one-place-out learning were lessaccurate than leave-one-person-out learning. Out resultssuggest that the eﬀect of the environment was greaterthan the eﬀect of the subjects. Thus, it will be necessary
to perform the experiments in more environmental
settings in the future.

Summary
In this study, we proposed a method for recognizing roomexits based on accelerometer and illuminance datacollected by MEMS sensors mounted on the mobilesensors. We assessed the discrimination accuracy using
three diﬀerent learning methods: leave-one-person-out
learning, leave-one-place-out learning, andleave-one-person-and-one-place-out learning.
Leave-one-person-out learning obtained particularly
accurate results. However, it will be necessary to increase
the walking recognition accuracy using other methods andfeature value calculations. Thus, we will aim to improve
the walking plus exit recognition accuracy by increasing
the accuracy of walking discrimination in future studies. Inaddition, we found that changes in the local environment
had greater eﬀects than the diﬀerences among subjects.
Therefore, we will assess the accuracy using various
environmental patterns. These verification experiments
will require large volumes of data, thus we plan to develop
methods to acquire data more easily. In future research,735

The part of this research are the following researches.
Basic research (B) Sensor context estimation techniquesby two levels of meaning layer and physical layer(Principal Investigator: Sozo Inoue)

References[1] Yuichi Hattori, Sozo Inoue, Go Hirakawa, Osamu
Sudo. ”Gathering Large Scale Human Activity
Information Using Mobile Sensor Devices ,International Workshop on Network Traﬃc Control,
Analysis and Applications (NTCAA-2010),
pp.708-713, Fukuoka, Japan, 2010.
[2] Yasunobu, Nohara, Sozo Inoue, Naoki Nakashima,
Naonori Ueda, Y Kitsuregawa, A Large-scaleSensor Dataset in a Hospital , International
Workshop on Pattern Recognition for Healthcare
Analytics, 4pages, November 11, 2012, Tsukuba.
[3] Naya Futoshi, Ren Ohmura, Haruo Noma, Kiyoshi
Kogure, Workflow Measurement and Analysis withWireless Sensor Network Systems , Informatio
Processing Society of Japan, (2009)[4] Naoto Migita, Yuichi Hattori, Syota Tanaka, Sozo
Inoue, Development and Evaluation of Behavioral
Similarity Evaluation System MimicMotion Using
Acceleration Data and Video , Multimedia,
Distributed, Cooperative, and Mobile
Symposium.1207-1216, July 10, 2013, Tokachi,Hokkaido.
[5] Chih-Chung Chang, Chih-Jen Lin, LIBSVM-A
Library for Support Vector Machines
http://www.csie.ntu.edu.tw/ cjlin/libsvm/