Context-detection API for Android developed as a university project
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

final.lyx 71KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729
  1. #LyX 1.6.5 created this file. For more info see http://www.lyx.org/
  2. \lyxformat 345
  3. \begin_document
  4. \begin_header
  5. \textclass article
  6. \use_default_options true
  7. \language english
  8. \inputencoding auto
  9. \font_roman default
  10. \font_sans default
  11. \font_typewriter default
  12. \font_default_family default
  13. \font_sc false
  14. \font_osf false
  15. \font_sf_scale 100
  16. \font_tt_scale 100
  17. \graphics default
  18. \paperfontsize default
  19. \spacing single
  20. \use_hyperref false
  21. \papersize a4paper
  22. \use_geometry false
  23. \use_amsmath 1
  24. \use_esint 1
  25. \cite_engine basic
  26. \use_bibtopic false
  27. \paperorientation portrait
  28. \secnumdepth 3
  29. \tocdepth 3
  30. \paragraph_separation skip
  31. \defskip medskip
  32. \quotes_language english
  33. \papercolumns 1
  34. \papersides 1
  35. \paperpagestyle default
  36. \tracking_changes false
  37. \output_changes false
  38. \author ""
  39. \author ""
  40. \end_header
  41. \begin_body
  42. \begin_layout Title
  43. Context-Aware API for Android Devices
  44. \end_layout
  45. \begin_layout Author
  46. Chris Smith
  47. \begin_inset Newline newline
  48. \end_inset
  49. Supervisor: Naranker Dulay
  50. \end_layout
  51. \begin_layout Date
  52. Summer 2010
  53. \end_layout
  54. \begin_layout Standard
  55. All materials can be accessed electronically at:
  56. \end_layout
  57. \begin_layout Standard
  58. /homes/cs106/....
  59. \end_layout
  60. \begin_layout Standard
  61. \begin_inset Newpage pagebreak
  62. \end_inset
  63. \end_layout
  64. \begin_layout Abstract
  65. In recent years location-based services have seen a dramatic increase in
  66. adoption, and all modern smartphone platforms have integrated services
  67. to facilitate the creation location-aware applications.
  68. Such applications enhance the experience of users, using location to modify
  69. content or alter the behaviour of the application to better suit the circumstan
  70. ces.
  71. \end_layout
  72. \begin_layout Abstract
  73. The product of this project is a
  74. \emph on
  75. context
  76. \emph default
  77. -aware API for the Android platform.
  78. This allows applications to augment the already available location data
  79. with extra
  80. \emph on
  81. context
  82. \emph default
  83. about the user's situation - primarily their current activity.
  84. It also develops an algorithm for recognising
  85. \emph on
  86. places
  87. \emph default
  88. which are relevant to the user, and monitoring which activities are performed
  89. in
  90. \emph on
  91. journeys
  92. \emph default
  93. between those places, thus enabling predictions of the user's likely destinatio
  94. n based on their activity.
  95. \end_layout
  96. \begin_layout Abstract
  97. Research into other methods of annotating context was conducted, and it
  98. was found that most potential sources of context information either produced
  99. little or no information, or were too battery-draining to perform in a
  100. real world environment with current technology.
  101. Much effort was placed into optimising the API to have as small effect
  102. on battery life as possible.
  103. \end_layout
  104. \begin_layout Abstract
  105. A context-aware API was successfully produced, along with a collection of
  106. applications which use the API in order to demonstrate its features or
  107. provide example use cases.
  108. \end_layout
  109. \begin_layout Standard
  110. \begin_inset Newpage pagebreak
  111. \end_inset
  112. \end_layout
  113. \begin_layout LyX-Code
  114. \begin_inset CommandInset toc
  115. LatexCommand tableofcontents
  116. \end_inset
  117. \end_layout
  118. \begin_layout LyX-Code
  119. \begin_inset Newpage pagebreak
  120. \end_inset
  121. \end_layout
  122. \begin_layout Part
  123. Introduction
  124. \end_layout
  125. \begin_layout Section
  126. Proposal
  127. \end_layout
  128. \begin_layout Quote
  129. Objective: to create an API for android applications to query the user's
  130. [probable] current activity, and to consider and implement possible uses
  131. for this API in existing applications.
  132. The user's activity would be determined based on available sensor and ambient
  133. data (e.g.
  134. time, location, orientation/movement of device, background noises, camera
  135. image, in-range bluetooth devices, etc), previous behaviour of the user,
  136. and possibly behaviour of other users which has been shared between devices.
  137. \end_layout
  138. \begin_layout Quote
  139. Motivation: Activity-awareness would be a major step forward in making mobile
  140. devices better able to adapt to what the user wants to do with them.
  141. The latest generation of mobile phones have made location-aware applications
  142. quite ubiquitous, and a lot of these could be further enhanced by making
  143. them activity aware.
  144. For example, an application which lists businesses in a certain area could
  145. not only know the search area (by merit of being location-aware), but could
  146. also make an educated guess at what you're looking for (e.g.
  147. the activity API may suggest the user is likely to be going to lunch, so
  148. the application could initially show nearby eating establishments instead
  149. of requiring the user to search for them).
  150. \end_layout
  151. \begin_layout Quote
  152. Challenges/issues: primary challenge is developing an algorithm which can
  153. make reasonable estimates as to the user's activity (or attempting and
  154. then justifying why such an algorithm is not feasible, and investigating
  155. requirements or alternatives), and would form the bulk of the project.
  156. Sub-challenges within this include: researching/implementing machine learning
  157. techniques so the algorithm can take previous behaviour into account, processin
  158. g data from 'messy' inputs such as mic/camera, and designing an API that
  159. would enable third-party app developers to easily make their applications
  160. activity aware.
  161. \end_layout
  162. \begin_layout Quote
  163. Approach: data from sensors would need to be processed (e.g.
  164. mic input processed into a figure for ambient noise level in dB).
  165. The combination of this processed data would then need to be fed into an
  166. algorithm (possibly a neural network) to determine likelihood of various
  167. activities.
  168. There would need to be some mechanism for users to correct or train the
  169. system (at least initially), and it's possible that this data could then
  170. be shared to other users of the api/application.
  171. \end_layout
  172. \begin_layout Section
  173. Aims and Motivation
  174. \end_layout
  175. \begin_layout Standard
  176. The primary aim of this project is to create an application for the Android
  177. platform that can sense the user's context in some fashion.
  178. This application will have a public interface which will allow other applicatio
  179. ns written by third party developers to read and receive updates about the
  180. user's context.
  181. \end_layout
  182. \begin_layout Standard
  183. The ease of access to location aware services in modern smartphone platforms
  184. has lead to a surge in the number of applications which improve their utility
  185. or behaviour by integrating location information.
  186. It stands to reason that if additional context information were available,
  187. developers would be able to take advantage of this and further improve
  188. the utility of their applications.
  189. This, in turn, would increase the productivity of the end-user.
  190. \end_layout
  191. \begin_layout Standard
  192. As discussed in
  193. \begin_inset CommandInset ref
  194. LatexCommand ref
  195. reference "par:Background"
  196. \end_inset
  197. , a large amount of existing research has been done on context-aware devices,
  198. and specifically on activity-aware systems.
  199. There have also been some limited implementations for smartphones.
  200. Unfortunately, the end product of most of this research is not suitable
  201. for deployment or use in practical, every-day circumstances.
  202. This project aims to produce a working prototype which can be used on a
  203. day-to-day basis on an Android smartphone without significantly degrading
  204. performance.
  205. \end_layout
  206. \begin_layout Section
  207. Issues and challenges
  208. \end_layout
  209. \begin_layout Standard
  210. One of the main challenges for this project will be accomplashing accurate
  211. and useful context-awareness without significantly hindering the battery
  212. life or performance of a typical device.
  213. Existing algorithms tend to be extremely verbose, sometimes performing
  214. upwards of thousands of calculations per classification; on a mobile device
  215. this is likely to severely cripple battery life.
  216. \end_layout
  217. \begin_layout Standard
  218. The problem of battery life affects all areas of the project - from how
  219. often data is collected, how the data is then analysed, and which sources
  220. of potential data are consulted.
  221. A large amount of time will need to be spent analysing the various potential
  222. data sources and establishing whether or not the cost in consulting them
  223. is worth the reduction in battery lifetime and any gain in the reliability
  224. or accuracy of context information.
  225. \end_layout
  226. \begin_layout Standard
  227. The aim of the application is to provide the context data to third-party
  228. applications, so another challenge will be designing an appropriate interface
  229. which will allow applications to query and receive updates about the user's
  230. context.
  231. Consideration will have to be given as to any security measures (such as
  232. access control) which may need to be applied in order to protect user privacy.
  233. \end_layout
  234. \begin_layout Standard
  235. \begin_inset Newpage pagebreak
  236. \end_inset
  237. \end_layout
  238. \begin_layout Part
  239. Background
  240. \begin_inset CommandInset label
  241. LatexCommand label
  242. name "par:Background"
  243. \end_inset
  244. \end_layout
  245. \begin_layout Standard
  246. Context- or Activity-Aware devices is an area currently under lots of research.
  247. There are many and varied applications of activity-aware devices, ranging
  248. from personal fitness and healthcare to training factory workers or merely
  249. playing music.
  250. \end_layout
  251. \begin_layout Standard
  252. While this research is going on, there has been a huge expansion in the
  253. ownership, use and power of mobile telephones.
  254. Mobile telephones are so ubiquitous and now come with such a large sensor
  255. platform that they are the obvious choice for implementing activity-aware
  256. technologies for use in day-to-day life.
  257. \end_layout
  258. \begin_layout Standard
  259. This project aims to make a context-aware API available on an open mobile
  260. platform, which will enable developers to start adding context-aware functional
  261. ity to their applications without the extremely large overhead of writing
  262. a logger and classifier themselves, or re-engineering the application to
  263. use an existing context-aware framework if one is available.
  264. \end_layout
  265. \begin_layout Section
  266. Applications
  267. \end_layout
  268. \begin_layout Standard
  269. There are many documented applications of activity-aware systems, and current
  270. research efforts which bring the technology to mobile telephones will only
  271. serve to lengthen this list.
  272. \end_layout
  273. \begin_layout Standard
  274. The canonical example for activity-awareness, especially on mobile telephones,
  275. is modeling the user's
  276. \begin_inset Quotes eld
  277. \end_inset
  278. interruptibility
  279. \begin_inset Quotes erd
  280. \end_inset
  281. \begin_inset CommandInset citation
  282. LatexCommand cite
  283. key "Siewiorek2003,Raento2005"
  284. \end_inset
  285. .
  286. This allows the software to know whether it's appropriate (or "polite")
  287. to disturb the user, and can advise the user's contacts when they are busy.
  288. It can also be used to create a
  289. \begin_inset Quotes eld
  290. \end_inset
  291. smart answering machine
  292. \begin_inset Quotes erd
  293. \end_inset
  294. \begin_inset CommandInset citation
  295. LatexCommand cite
  296. key "Hudson2003"
  297. \end_inset
  298. which can selectively direct calls straight to an answering machine if
  299. the user is engaged in an "uninterpretable" activity and the call does
  300. not appear to be important.
  301. These allow the user's mobile telephone to better approximate human behaviour
  302. - when approaching someone in person it is normally quite easy to determine
  303. whether it would be polite or necessary to disturb them, based on their
  304. demeanour, activity, and the urgency of your request; when picking up the
  305. telephone it is not possible at all without assistance from an activity-aware
  306. system.
  307. \end_layout
  308. \begin_layout Standard
  309. The current implementations of these ideas have several problems, however.
  310. The more interesting research
  311. \begin_inset CommandInset citation
  312. LatexCommand cite
  313. key "Hudson2003"
  314. \end_inset
  315. requires a static camera fixed in an office to observe user behaviour,
  316. instead of implementing it directly on a telephone, which obviously constrains
  317. its usefulness.
  318. Of the two solutions actually targeted at mobile telephones, one
  319. \begin_inset CommandInset citation
  320. LatexCommand cite
  321. key "Siewiorek2003"
  322. \end_inset
  323. requires bulky custom hardware which the user must carry on their belt,
  324. and the other
  325. \begin_inset CommandInset citation
  326. LatexCommand cite
  327. key "Raento2005"
  328. \end_inset
  329. does not expose an API to other applications and only surfaces the context-aware
  330. functionality in two small applications whose focus is on social interaction
  331. rather than improving the user's experience of the telephone locally.
  332. This project will aim to bring the ideas of these to generic hardware (an
  333. Android mobile telephone), and to provide an API which other applications
  334. can harness.
  335. \end_layout
  336. \begin_layout Standard
  337. One use particularly suitable for mobile phones is dynamic adaptation of
  338. the device's settings based on the user's current activity and context
  339. \begin_inset CommandInset citation
  340. LatexCommand cite
  341. key "Schmidt1999"
  342. \end_inset
  343. .
  344. When a user is walking the device can dynamically increase the font size
  345. to make it easier to read with an unsteady hand, and correspondingly decrease
  346. it when the user is stationary.
  347. In a similar fashion, the brightness of the backlight can be altered based
  348. on the ambient light level, and the ringer volume altered according to
  349. the noise level.
  350. Unfortunately this research did not progress beyond a feasibility study
  351. and was implemented on a Nokia 6110, which is severely outdated by today's
  352. standards.
  353. \end_layout
  354. \begin_layout Standard
  355. Another popular area for activity-aware systems is in healthcare.
  356. Such systems can be used to monitor vulnerable people as they go about
  357. day to day activities to ensure that they're not in trouble - several systems
  358. \begin_inset CommandInset citation
  359. LatexCommand cite
  360. key "Song2005,Maurer2006"
  361. \end_inset
  362. can be used to monitor elderly persons and summon help if it is detected
  363. that they have fallen.
  364. Another healthcare application
  365. \begin_inset CommandInset citation
  366. LatexCommand cite
  367. key "Tentori2008"
  368. \end_inset
  369. allows nurses to remotely monitor the activities of their patients in a
  370. hospital ward, allowing them to respond to problems and keep up-to-date
  371. with their patients' well-being while not physically present.
  372. Activity-aware applications have also been used to try to encourage users
  373. to be more healthy; one novel application records the day-to-day fitness
  374. activities a user performs and uses this as a basis for a virtual
  375. \begin_inset Quotes eld
  376. \end_inset
  377. garden
  378. \begin_inset Quotes erd
  379. \end_inset
  380. that blossoms or wilts according to how much the user works out in a week
  381. \begin_inset CommandInset citation
  382. LatexCommand cite
  383. key "Consolvo2008"
  384. \end_inset
  385. .
  386. \end_layout
  387. \begin_layout Standard
  388. As well as monitoring activities which the user is familiar with, activity-aware
  389. systems can also be used to assist users in learning new activities.
  390. One application
  391. \begin_inset CommandInset citation
  392. LatexCommand cite
  393. key "Stiefmeier2008"
  394. \end_inset
  395. monitors the activities of trainee workers in a car manufacturing plant,
  396. and helps to provide a link between theoretical classroom-based training
  397. and practical work.
  398. The activity-aware system can offer advice to the workers that's directly
  399. related to the current task they're performing, and can even monitor their
  400. activities for compliance with procedures and give them a score afterwards.
  401. \end_layout
  402. \begin_layout Standard
  403. While the research into healthcare and training applications present novel
  404. uses of activity-aware systems, the applications themselves are not really
  405. applicable to a mobile device or the scope of this project.
  406. The research does, however, describe the techniques used in those applications
  407. for activity classification and should prove useful in that respect.
  408. \end_layout
  409. \begin_layout Standard
  410. Other areas of research include making activity-aware suggestions to the
  411. user
  412. \begin_inset CommandInset citation
  413. LatexCommand cite
  414. key "Bellotti2008"
  415. \end_inset
  416. , or issuing reminders or alerts based on the user's activity
  417. \begin_inset CommandInset citation
  418. LatexCommand cite
  419. key "Schilit1994"
  420. \end_inset
  421. .
  422. One example of the latter is an activity-aware system that detects when
  423. the user is making coffee, and plays a sound on a remote computer to alert
  424. thirsty coworkers to the fact.
  425. Sound isn't only limited to alerts, however: the
  426. \noun on
  427. XPOD
  428. \noun default
  429. \begin_inset CommandInset citation
  430. LatexCommand cite
  431. key "Dornbush2005"
  432. \end_inset
  433. project is an activity-aware music player, which tailors the music being
  434. played to the user's current activity based on their past ratings.
  435. This type of activity-aware device presents a much greater level of personalisa
  436. tion than previously possible, and making this type of customisation available
  437. to mobile telephone users and application developers will surely result
  438. in many new applications.
  439. \end_layout
  440. \begin_layout Section
  441. Inferring activity
  442. \end_layout
  443. \begin_layout Standard
  444. There are three general phases in most context-aware systems: a sensing
  445. component, which reads or receives raw sensor data relating to the user's
  446. environment or activity; a feature extraction component, which analysis
  447. the sensor data and identifies a set of features from that data; and a
  448. classification component, which uses the extracted features to reason about
  449. the user's activity
  450. \begin_inset CommandInset citation
  451. LatexCommand cite
  452. key "Choudhury2008"
  453. \end_inset
  454. .
  455. Each of these components will be expanded on below.
  456. Depending on the method of classification, some initial or continuous training
  457. may be required, and this is also considered below.
  458. \end_layout
  459. \begin_layout Subsection
  460. Sensors and devices
  461. \end_layout
  462. \begin_layout Standard
  463. At the basis of activity-recognition are the physical hardware sensors.
  464. The most commonly used sensor is the accelerometer, which outputs the accelerat
  465. ion of the sensor
  466. \begin_inset Foot
  467. status collapsed
  468. \begin_layout Plain Layout
  469. and thus the device to which it's attached, and therefore the person using
  470. the device
  471. \end_layout
  472. \end_inset
  473. along a certain axis.
  474. There is extensive research on using accelerometers to classify activities
  475. such as walking
  476. \begin_inset CommandInset citation
  477. LatexCommand cite
  478. key "Mathie2004,Garakani2009"
  479. \end_inset
  480. (including whether or not the subject is walking on flat ground or up and
  481. down stairs
  482. \begin_inset CommandInset citation
  483. LatexCommand cite
  484. key "Caros2005"
  485. \end_inset
  486. ), running
  487. \begin_inset CommandInset citation
  488. LatexCommand cite
  489. key "Garakani2009"
  490. \end_inset
  491. , falling
  492. \begin_inset CommandInset citation
  493. LatexCommand cite
  494. key "Mathie2004"
  495. \end_inset
  496. , sitting
  497. \begin_inset CommandInset citation
  498. LatexCommand cite
  499. key "Mathie2004,Garakani2009"
  500. \end_inset
  501. , cycling
  502. \begin_inset CommandInset citation
  503. LatexCommand cite
  504. key "Garakani2009"
  505. \end_inset
  506. , etc.
  507. \end_layout
  508. \begin_layout Standard
  509. Accelerometers can be combined with magnetic field sensors to convert the
  510. relative acceleration of the device into an absolute acceleration with
  511. respect to the Earth.
  512. This is particularly important when the sensor platform - a mobile telephone
  513. - can be oriented in different ways while performing the same activity.
  514. There are, for example, four different ways to comfortably fit a typical
  515. smartphone into a trouser pocket, made up of two possible orientations
  516. around two axis
  517. \begin_inset Foot
  518. status collapsed
  519. \begin_layout Plain Layout
  520. screen facing towards or away from the body, and the device oriented the
  521. right way up or upside down
  522. \end_layout
  523. \end_inset
  524. .
  525. With just raw accelerometer data these four orientations would lead to
  526. different data for the same activity, but with the combination of magnetic
  527. field sensors we can normalise them.
  528. \end_layout
  529. \begin_layout Standard
  530. Smartphones also come equipped with a microphone and GSM stack (prerequisites
  531. for a telephone conversation!), and commonly a camera, geolocation API
  532. (usually backed by GPS) and Bluetooth stack.
  533. With the exception of the latter two, these types of sensors are not particular
  534. ly well explored for their use in context-aware systems at present.
  535. It is easy to reason how each would be useful - a microphone can reveal
  536. the ambient noise, which could indicate the difference between sitting
  537. in a library and a bar; the camera likewise can reveal the lighting conditions
  538. (if the device is not in a pocket or bag).
  539. The GSM stack can provide rough location information and also a signal
  540. strength to one or more cell towers; the signal strength will vary both
  541. with the user's proximity to the cell tower and the environment around
  542. them - being inside will degrade the signal more than being in open air,
  543. for example - so may provide vital clues to a context-aware system.
  544. One aspect of this project will be to research how the microphone, camera
  545. and GSM stack can be used to enhance existing activity classification algorithm
  546. s.
  547. \end_layout
  548. \begin_layout Standard
  549. Current research on location information and Bluetooth device proximity
  550. is summarised in section
  551. \begin_inset CommandInset ref
  552. LatexCommand ref
  553. reference "sec:Location-analysis"
  554. \end_inset
  555. (p
  556. \begin_inset CommandInset ref
  557. LatexCommand pageref
  558. reference "sec:Location-analysis"
  559. \end_inset
  560. ) and
  561. \begin_inset CommandInset ref
  562. LatexCommand ref
  563. reference "sec:Bluetooth"
  564. \end_inset
  565. (p
  566. \begin_inset CommandInset ref
  567. LatexCommand pageref
  568. reference "sec:Bluetooth"
  569. \end_inset
  570. ) respectively.
  571. \end_layout
  572. \begin_layout Subsection
  573. Feature detection
  574. \end_layout
  575. \begin_layout Standard
  576. It is not possible to reason directly about raw sensor inputs, so the next
  577. step in inferring activities is to extract useful
  578. \emph on
  579. features
  580. \emph default
  581. from the raw input.
  582. Features are usually mathematical properties of the input data, such as
  583. the difference between the minimum and maximum data point in a given time
  584. frame.
  585. Most classifiers use an extremely large number of features -
  586. \begin_inset CommandInset citation
  587. LatexCommand citet
  588. key "Hein2008"
  589. \end_inset
  590. detect 562 different features from their inputs.
  591. \end_layout
  592. \begin_layout Standard
  593. Some of the more commonly used features in activity-recognition systems
  594. are: mean, standard deviation, energy, entropy, correlation between axis,
  595. and discrete FFT coefficients
  596. \begin_inset CommandInset citation
  597. LatexCommand cite
  598. key "Huynh2005"
  599. \end_inset
  600. .
  601. Obviously, not all features are of equal value.
  602. FFT coefficients are generally very good indicators of activity, but the
  603. ideal coefficients and window sizes vary depending on the exact activity
  604. that is being detected.
  605. Likewise, the choice of other features to give the best recognition rate
  606. varies depending on the activity being detected
  607. \begin_inset CommandInset citation
  608. LatexCommand cite
  609. key "Huynh2005"
  610. \end_inset
  611. .
  612. \end_layout
  613. \begin_layout Standard
  614. As the sensor data is received continuously, it needs to be partitioned
  615. somehow before features are extracted.
  616. Most implementations use a sliding window approach with a 50% overlap between
  617. windows
  618. \begin_inset CommandInset citation
  619. LatexCommand cite
  620. key "Bao2004"
  621. \end_inset
  622. .
  623. A window size of 10 seconds with a 50% overlap would result in one set
  624. of features being computed every 5 seconds.
  625. The window size is normally selected to correspond to a pre-defined number
  626. of samples to enable fast computation of certain features - most notably
  627. FFTs
  628. \begin_inset CommandInset citation
  629. LatexCommand cite
  630. key "Bao2004"
  631. \end_inset
  632. .
  633. \end_layout
  634. \begin_layout Standard
  635. One challenge will be determining a set of features that are robust enough
  636. to perform activity analysis on, but are sufficiently inexpensive to calculate
  637. continually on a mobile device, where CPU speed is limited and excessive
  638. usage results in undesirable higher battery consumption.
  639. \end_layout
  640. \begin_layout Subsection
  641. Training
  642. \end_layout
  643. \begin_layout Standard
  644. In order to meaningfully classify and label activities, some kind of training
  645. generally needs to be performed beforehand.
  646. The choice of classifier affects how much offline analysis has to be done
  647. on the training set, and whether or not it can be adapted at run-time.
  648. \end_layout
  649. \begin_layout Standard
  650. One might expect that training would best be performed in a controlled environme
  651. nt, to reduce external influences on the user, but subjects in a laboratory
  652. setting are much more self-conscious about their movements, and this manifests
  653. itself in the data collected.
  654. Walking in a laboratory tends to produce acceleration data showing a consistent
  655. gait cycle which can be split into distinct phases, whereas walking in
  656. an uncontrolled setting produces data showing large fluctuations in gait
  657. phases and length.
  658. This means that classifiers trained on laboratory data may achieve a much
  659. lower accuracy when deployed in natural conditions
  660. \begin_inset CommandInset citation
  661. LatexCommand cite
  662. key "Bao2004"
  663. \end_inset
  664. .
  665. \end_layout
  666. \begin_layout Subsection
  667. Classification
  668. \end_layout
  669. \begin_layout Standard
  670. The classification step involves feeding the features for frame into some
  671. kind of machine learning algorithm which can, using training data
  672. \begin_inset Foot
  673. status collapsed
  674. \begin_layout Plain Layout
  675. and any offline analysis made of that data
  676. \end_layout
  677. \end_inset
  678. , determine which activity the feature-set most like represents.
  679. There are many different algorithms that can be used to perform the classificat
  680. ion, some of which are discussed below.
  681. \end_layout
  682. \begin_layout Subsubsection
  683. Decision trees
  684. \end_layout
  685. \begin_layout Standard
  686. Decision trees are possibly one of the simplest approaches possible
  687. \begin_inset CommandInset citation
  688. LatexCommand cite
  689. key "Hudson2003"
  690. \end_inset
  691. .
  692. A tree is constructed such that each node contains a test function, with
  693. branches for each possible discrete outcome of the function.
  694. This allows data to be classified with a
  695. \begin_inset Quotes eld
  696. \end_inset
  697. divide and conquer
  698. \begin_inset Quotes erd
  699. \end_inset
  700. approach.
  701. While high accuracy is possible in some circumstances
  702. \begin_inset CommandInset citation
  703. LatexCommand cite
  704. key "Hudson2003"
  705. \end_inset
  706. , there are several drawbacks to decision trees: a plain decision tree has
  707. no way to model uncertainty - in an activity-aware system there will always
  708. be a degree of uncertainty as to the classification, and being able to
  709. measure this is an important tool.
  710. They also have an inductive bias which leads to a preference for the most
  711. general solution, and in most cases this generalisation causes many false
  712. results
  713. \begin_inset CommandInset citation
  714. LatexCommand cite
  715. key "Shen2004"
  716. \end_inset
  717. .
  718. \end_layout
  719. \begin_layout Standard
  720. Decision trees require the structure of the tree and the test functions
  721. for each node to be determined during training.
  722. They do not lend themselves to minor on-the-fly modifications or new activities
  723. that are not part of the training set.
  724. \end_layout
  725. \begin_layout Subsubsection
  726. Neural networks
  727. \end_layout
  728. \begin_layout Standard
  729. Neural networks are based on an extremely simplified model of the brain.
  730. The network consists of layers of neurons, and each neuron performs a simple
  731. arithmetic operation on its inputs.
  732. This normally consists of taking each of its inputs, multiplying it by
  733. a weight, and then summing all of the weighted inputs together; the resulting
  734. figure then becomes the neuron's output, and the input to one or more nodes
  735. in the next layer.
  736. \end_layout
  737. \begin_layout Standard
  738. A network consists of a layer of input neurons, a layer containing one or
  739. more output neurons, and one or more layers of
  740. \begin_inset Quotes eld
  741. \end_inset
  742. hidden
  743. \begin_inset Quotes erd
  744. \end_inset
  745. neurons in between.
  746. The number of
  747. \begin_inset Quotes eld
  748. \end_inset
  749. hidden
  750. \begin_inset Quotes erd
  751. \end_inset
  752. layers, and the number of neurons within those layers must be chosen before
  753. training of the network begins.
  754. The training process will then determine the weights for each link in the
  755. network.
  756. The choice of number of layers poses a problem when designing a network,
  757. as too small a number can cripple the power of the network, but too large
  758. can cause it to be too expensive to evaluate and can possibly lead to it
  759. memorising erroneous data
  760. \begin_inset CommandInset citation
  761. LatexCommand cite
  762. key "Dornbush2005"
  763. \end_inset
  764. .
  765. \end_layout
  766. \begin_layout Standard
  767. Neural networks, however, do provide good accuracy and could potentially
  768. (although not easily) be modified on-the-fly to cope with new activities.
  769. \end_layout
  770. \begin_layout Subsubsection
  771. Genetic algorithms
  772. \end_layout
  773. \begin_layout Standard
  774. Genetic algorithms use the principle of natural selection to 'evolve' a
  775. solution to a problem.
  776. A set of random solutions are created, and a pre-defined fitness function
  777. is used to determine their relative worth.
  778. The best solutions are then combined together to produce the next generation
  779. of solutions, in a manner roughly analogous to reproduction in animals.
  780. Small
  781. \begin_inset Quotes eld
  782. \end_inset
  783. mutations
  784. \begin_inset Quotes erd
  785. \end_inset
  786. are also introduced into each generation to counter the effect of local
  787. maxima being reached.
  788. \end_layout
  789. \begin_layout Standard
  790. Genetic algorithms can be combined with other techniques such as neural
  791. networks - the weights in the neural network can be
  792. \begin_inset Quotes eld
  793. \end_inset
  794. evolved
  795. \begin_inset Quotes erd
  796. \end_inset
  797. using genetic algorithms to create a neural network which is good as satisfying
  798. the fitness function.
  799. \end_layout
  800. \begin_layout Standard
  801. The drawback of genetic algorithms is the need for a fitness function -
  802. the network will only ever be as good as the fitness function, and if you
  803. have a way to define what makes a good network you could in most cases
  804. hardcode the solution instead of evolving a network to satisfy it.
  805. \end_layout
  806. \begin_layout Subsubsection
  807. Instance-based learning
  808. \end_layout
  809. \begin_layout Standard
  810. Instance-based learning (IBL)
  811. \begin_inset CommandInset citation
  812. LatexCommand cite
  813. key "Witten2000"
  814. \end_inset
  815. algorithms are a class of
  816. \begin_inset Quotes eld
  817. \end_inset
  818. lazy
  819. \begin_inset Quotes erd
  820. \end_inset
  821. algorithms.
  822. They perform classification based on previously observed instances that
  823. have already been classified.
  824. There is no training required for IBLs, they're extremely adept at adapting
  825. to new scenarios, and they have a very low error rate
  826. \begin_inset CommandInset citation
  827. LatexCommand cite
  828. key "Dornbush2005"
  829. \end_inset
  830. which makes them ideal for activity-recognition.
  831. \end_layout
  832. \begin_layout Standard
  833. One particular type of IBL algorithm which is frequently seen in activity-aware
  834. research is the K-Nearest Neighbour (KNN) algorithm
  835. \begin_inset CommandInset citation
  836. LatexCommand cite
  837. key "Han2006"
  838. \end_inset
  839. .
  840. With the KNN algorithm, each sample is treated as a vector, and the distance
  841. \begin_inset Foot
  842. status collapsed
  843. \begin_layout Plain Layout
  844. the euclidean distance is usually used, but any metric will suffice
  845. \end_layout
  846. \end_inset
  847. between the sample and the existing instances is calculated.
  848. The sample is then classified according to the classification of the majority
  849. of its
  850. \begin_inset Formula $k$
  851. \end_inset
  852. nearest neighbours.
  853. \end_layout
  854. \begin_layout Standard
  855. One drawback of IBLs is that each new instance tends to be remembered for
  856. future use, which eventually results in large amounts of memory consumption
  857. and complexity when comparing distances of new samples.
  858. This can be partially overcome by only storing instances which would affect
  859. the classification of new samples
  860. \begin_inset CommandInset citation
  861. LatexCommand cite
  862. key "Witten2000"
  863. \end_inset
  864. .
  865. \end_layout
  866. \begin_layout Standard
  867. The KNN algorithm can be easily extended to support dynamic classification
  868. of new types of activities - if a sample is not within a certain distance
  869. of sufficient other samples, it can be classified as a new type of activity.
  870. \end_layout
  871. \begin_layout Subsubsection
  872. Conclusion
  873. \end_layout
  874. \begin_layout Standard
  875. There are numerous machine learning algorithms available and suitable for
  876. use in activity classification tasks.
  877. There has been a lot of research into their use, and all of the algorithms
  878. discussed have produced good results.
  879. Because of the lack of need for any training, however, the K-Nearest Neighbour
  880. algorithm appears to be the most promising for a mobile device.
  881. Any algorithm that needs explicit training prior to classification would
  882. almost certainly require a desktop application or a remote service to analyse
  883. the data, as it typically requires large amounts of memory and expensive
  884. computations.
  885. This either makes the application extremely cumbersome for the user (they
  886. have to connect their phone to a computer, transfer a file, obtain and
  887. run a separate application, then transfer some file back), or puts a large
  888. resource burden onto the distributor (having to remotely analyse all of
  889. the data from all users would require dedicated hardware for any more than
  890. a few users).
  891. \end_layout
  892. \begin_layout Section
  893. Mobile telephones
  894. \end_layout
  895. \begin_layout Standard
  896. It's hard to overstate the ubiquity of mobile telephones at present.
  897. In 2003, over a billion mobile telephones were sold - six times as many
  898. as the number of personal computers
  899. \begin_inset CommandInset citation
  900. LatexCommand cite
  901. key "Eagle2004"
  902. \end_inset
  903. .
  904. In 2007, this same figure describes the number of cameraphones sold
  905. \begin_inset CommandInset citation
  906. LatexCommand cite
  907. key "Reynolds2008"
  908. \end_inset
  909. , clearly representing a substantial growth in sales and advancements in
  910. the technology.
  911. In fact, mobile telephones are the fastest adopted technology in human
  912. history
  913. \begin_inset CommandInset citation
  914. LatexCommand cite
  915. key "Eagle2004"
  916. \end_inset
  917. .
  918. This ubiquity, coupled with the fact that mobile telephones are comfortably
  919. carried around on a daily basis by most of their users, makes them a very
  920. attractive alternative to more traditional platforms used for activity-aware
  921. research, which typically involved bulky or inconvenient apparatus that
  922. was expensive to manufacture
  923. \begin_inset CommandInset citation
  924. LatexCommand cite
  925. key "Schmidt2008"
  926. \end_inset
  927. and made users very self-conscious.
  928. \end_layout
  929. \begin_layout Subsection
  930. iPhone
  931. \end_layout
  932. \begin_layout Standard
  933. There have been several published works related to activity-recognition
  934. on the iPhone.
  935. The similarity between iPhone and Android platforms means that many of
  936. the concepts developed for or used on the iPhone are applicable to both.
  937. \end_layout
  938. \begin_layout Subsubsection
  939. iLearn
  940. \end_layout
  941. \begin_layout Standard
  942. \noun on
  943. iLearn
  944. \noun default
  945. \begin_inset CommandInset citation
  946. LatexCommand cite
  947. key "Schmidt2008"
  948. \end_inset
  949. is a suite of three tools -
  950. \noun on
  951. iLog
  952. \noun default
  953. ,
  954. \noun on
  955. iModel,
  956. \noun default
  957. and
  958. \noun on
  959. iClassify
  960. \noun default
  961. - which together allow for real-time classification of low-level activities.
  962. \noun on
  963. iLog
  964. \noun default
  965. is run on the user's iPhone and allows the user to specify which activity
  966. they will be performing.
  967. The application then records raw sensor data from the iPhone's three-axis
  968. accelerometer and 124 features computed from this data in real-time.
  969. The data is then stored on the device, annotated with the selected activity.
  970. \end_layout
  971. \begin_layout Standard
  972. The training data collected by
  973. \noun on
  974. iLog
  975. \noun default
  976. is then transferred to a desktop computer where
  977. \noun on
  978. iModel
  979. \noun default
  980. uses a Naïve Bayesian Network (NBN) to create a model which can be used
  981. to classify future input.
  982. The choice of NBNs was based on their ability to classify a set of trial
  983. data correctly, and the low computational cost of classifying data once
  984. the model has been generated.
  985. \end_layout
  986. \begin_layout Standard
  987. Once the model has been created, it is transferred back to the device where
  988. it is used by
  989. \noun on
  990. iClassify
  991. \noun default
  992. .
  993. This provides an API for other applications, and allows them to register
  994. for a callback which it publishes the user's current activity to every
  995. second.
  996. \end_layout
  997. \begin_layout Standard
  998. Unfortunately, neither the source code nor the API are published.
  999. The inability to run background processes on the iPhone suggests that any
  1000. \begin_inset Quotes eld
  1001. \end_inset
  1002. API
  1003. \begin_inset Quotes erd
  1004. \end_inset
  1005. would have to be more like a framework where the third-party developer
  1006. has to re-engineer their application to use the
  1007. \noun on
  1008. iClassify
  1009. \noun default
  1010. application as a base.
  1011. This is undesirable as it makes it extremely difficult to adapt existing
  1012. applications to use the activity-aware API, and is a very cumbersome way
  1013. of providing what could be a very minor piece of functionality for the
  1014. application.
  1015. \end_layout
  1016. \begin_layout Subsubsection
  1017. Evaluation
  1018. \end_layout
  1019. \begin_layout Standard
  1020. \begin_inset CommandInset citation
  1021. LatexCommand citet
  1022. key "Miluzzo2009"
  1023. \end_inset
  1024. present an evaluation of the iPhone for use in
  1025. \begin_inset Quotes eld
  1026. \end_inset
  1027. people-centric sensing applications
  1028. \begin_inset Quotes erd
  1029. \end_inset
  1030. .
  1031. One of the major drawbacks highlighted is that the iPhone does not support
  1032. applications which run in the background.
  1033. This means that any application wishing to perform continuous real-time
  1034. activity detection would need to run as a foreground process, preventing
  1035. the user from using the device for any other function.
  1036. \end_layout
  1037. \begin_layout Standard
  1038. The research also shows that the computational compatibility of the iPhone
  1039. is more than sufficient to perform the necessary calculations for a typical
  1040. activity-recognising application, which suggests that any modern smart
  1041. phone would be capable of these.
  1042. \end_layout
  1043. \begin_layout Subsection
  1044. Android
  1045. \end_layout
  1046. \begin_layout Standard
  1047. While the Android platform is relatively new, it is rapidly gaining market
  1048. share on the more established mobile operating systems.
  1049. A December 2009 survey
  1050. \begin_inset CommandInset citation
  1051. LatexCommand cite
  1052. key "ChangeWave2010"
  1053. \end_inset
  1054. shows that 21% of respondents want their next smartphone purchase to run
  1055. Android, a 350% increase from the same survey conducted three months prior.
  1056. This is compared to the iPhone, which dropped 4% to 28% in the same time
  1057. period.
  1058. Gartner, a respected IT research firm, predicts that by 2012, Android will
  1059. be the second most popular mobile operating system globally
  1060. \begin_inset CommandInset citation
  1061. LatexCommand cite
  1062. key "ComputerWorld2010"
  1063. \end_inset
  1064. .
  1065. \end_layout
  1066. \begin_layout Standard
  1067. In addition to its rapidly increasing popularity, the Android platform offers
  1068. several advantages over the iPhone platform.
  1069. Most notably is the ability to run background processes (called
  1070. \noun on
  1071. services
  1072. \noun default
  1073. ), which will allow a classifier application to run without interfering
  1074. with the user's normal use of their mobile telephone.
  1075. In addition, the Android OS provides access to the Bluetooth and GSM stacks,
  1076. allowing for data from both to be used for activity detection.
  1077. \end_layout
  1078. \begin_layout Standard
  1079. The ability to run a background process will enable a proper API for sharing
  1080. activity data with other applications, which will allow third-party developers
  1081. to make their applications context-aware with relatively little work on
  1082. their part.
  1083. This is extremely desirable as it will allow rapid prototyping of applications,
  1084. which will hopefully lead to innovative new uses of activity classification.
  1085. \end_layout
  1086. \begin_layout Standard
  1087. While it is purported
  1088. \begin_inset CommandInset citation
  1089. LatexCommand cite
  1090. key "Garakani2009"
  1091. \end_inset
  1092. that there is research being done on bringing activity-awareness to Android
  1093. platforms, there does not seem to be any work published on this matter
  1094. or any applications available to support it.
  1095. While there a small number of self-proclaimed
  1096. \begin_inset Quotes eld
  1097. \end_inset
  1098. context-aware
  1099. \begin_inset Quotes erd
  1100. \end_inset
  1101. applications for Android, this context is almost exclusively limited to
  1102. geolocation.
  1103. This project will therefore produce one of the first publicly available
  1104. activity-aware applications for the Android platform.
  1105. \end_layout
  1106. \begin_layout Section
  1107. Location analysis
  1108. \begin_inset CommandInset label
  1109. LatexCommand label
  1110. name "sec:Location-analysis"
  1111. \end_inset
  1112. \end_layout
  1113. \begin_layout Standard
  1114. Location-based services are currently undergoing an
  1115. \begin_inset Quotes eld
  1116. \end_inset
  1117. explosion
  1118. \begin_inset Quotes erd
  1119. \end_inset
  1120. \begin_inset CommandInset citation
  1121. LatexCommand cite
  1122. key "Bellavista2008"
  1123. \end_inset
  1124. , thanks to improvements in technology, and greater openness on the part
  1125. of service providers and handset manufacturers.
  1126. All modern smartphone platforms have a geolocation stack, usually backed
  1127. by a GPS chipset and in most cases augmented with either a database of
  1128. known cell tower locations, or a map of known wifi network identifiers
  1129. and locations, or both.
  1130. The two databases allow for rough geolocation when GPS is not available,
  1131. or for greatly decreased lookup time when a GPS lock is available.
  1132. \end_layout
  1133. \begin_layout Standard
  1134. However, while the geolocation stack is a rich source of data, it is a poor
  1135. source of information.
  1136. A latitude/longitude pair may describe the user's exact location, but a
  1137. user would be hard-pressed to tell the difference between the latitude/longitud
  1138. e of their home, place of work, or of somewhere in between the two with
  1139. no real significance.
  1140. A great deal of research has therefore been devoted to detecting meaningful
  1141. locations from GPS traces.
  1142. \end_layout
  1143. \begin_layout Standard
  1144. \begin_inset Quotes eld
  1145. \end_inset
  1146. Place recognition
  1147. \begin_inset Quotes erd
  1148. \end_inset
  1149. has two phases: learning and recognising.
  1150. An initial learning phase analyses a sensor log and segments the data into
  1151. places where the device is stable (stationary), and designates this as
  1152. a
  1153. \begin_inset Quotes eld
  1154. \end_inset
  1155. waypoint
  1156. \begin_inset Quotes erd
  1157. \end_inset
  1158. .
  1159. It then merges
  1160. \begin_inset Quotes eld
  1161. \end_inset
  1162. waypoints
  1163. \begin_inset Quotes erd
  1164. \end_inset
  1165. that appear to identify the same place being visited multiple times.
  1166. The second phase uses these learned waypoints to recognise when the device
  1167. is revisiting a place, and therefore also when the device is not visiting
  1168. a previously known place (for example when it is moving between two)
  1169. \begin_inset CommandInset citation
  1170. LatexCommand cite
  1171. key "Hightower2005"
  1172. \end_inset
  1173. .
  1174. \end_layout
  1175. \begin_layout Standard
  1176. Unfortunately, quite a lot of research into location analysis uses GPS
  1177. \begin_inset Quotes eld
  1178. \end_inset
  1179. blackspots
  1180. \begin_inset Quotes erd
  1181. \end_inset
  1182. to identify useful places
  1183. \begin_inset CommandInset citation
  1184. LatexCommand cite
  1185. key "Nurmi2006,Liao2007b"
  1186. \end_inset
  1187. .
  1188. With older GPS chipsets, the satellite signal would be lost when the user
  1189. entered a building, and this allowed an inference that the current location
  1190. was probably a place of interest.
  1191. However, modern GPS chipsets receive a signal in most indoor locations.
  1192. It is possible that a decrease in signal strength or number of locked satellite
  1193. s may still occur, or that GSM signal strength could be used instead, but
  1194. these ideas have not been widely explored at present.
  1195. \end_layout
  1196. \begin_layout Standard
  1197. There is, however, plenty of research relating to the use of location data
  1198. outdoors.
  1199. One application
  1200. \begin_inset CommandInset citation
  1201. LatexCommand cite
  1202. key "Liao2007b"
  1203. \end_inset
  1204. learns not only the user's frequently visited places, but the method of
  1205. transport used between them and the typical routes taken.
  1206. It can then offer instructions showing the user how to go from place to
  1207. place, or issue alerts if the user appears to be going the wrong way (by
  1208. getting on the wrong bus, for instance).
  1209. The ability to correctly infer the user's destination would be extremely
  1210. useful in a context-aware system: a user walking to do their grocery shopping
  1211. is almost certainly going to want to interact with their phone differently
  1212. than a user on a bus going to work.
  1213. \end_layout
  1214. \begin_layout Section
  1215. Bluetooth
  1216. \begin_inset CommandInset label
  1217. LatexCommand label
  1218. name "sec:Bluetooth"
  1219. \end_inset
  1220. \end_layout
  1221. \begin_layout Standard
  1222. The user's context depends on not only what they are doing, where they are
  1223. doing it, but also who they are with.
  1224. Sitting and eating lunch with a manager is quite a different context to
  1225. sitting and eating lunch with a spouse.
  1226. It would therefore be desirable to be able to identify between different
  1227. people when performing context analysis.
  1228. \end_layout
  1229. \begin_layout Standard
  1230. One of the few ways that a mobile telephone can identify other people is
  1231. by searching for
  1232. \emph on
  1233. their
  1234. \emph default
  1235. mobile telephones.
  1236. This can be done by scanning for Bluetooth devices, which involves broadcasting
  1237. a
  1238. \begin_inset Quotes eld
  1239. \end_inset
  1240. device inquiry
  1241. \begin_inset Quotes erd
  1242. \end_inset
  1243. message; if a device chooses to answer the inquiry, it discloses its unique
  1244. MAC address and device class
  1245. \begin_inset Foot
  1246. status collapsed
  1247. \begin_layout Plain Layout
  1248. the device class tells us whether the device is a computer or a mobile telephone
  1249. , for example
  1250. \end_layout
  1251. \end_inset
  1252. .
  1253. Unfortunately, this requires the person to not only be carrying a mobile
  1254. telephone, but a Bluetooth-enabled model, and for them to have configured
  1255. their device to have Bluetooth enabled and to be
  1256. \begin_inset Quotes eld
  1257. \end_inset
  1258. visible
  1259. \begin_inset Quotes erd
  1260. \end_inset
  1261. .
  1262. A study in 2004
  1263. \begin_inset CommandInset citation
  1264. LatexCommand cite
  1265. key "Eagle2004"
  1266. \end_inset
  1267. found that only 1 in 150 people had such a configured device on a university
  1268. campus.
  1269. This figure will undoubtedly be greater now, and may well be greater when
  1270. in public, but it highlights that only a handful of people may be detectable
  1271. via their Bluetooth devices.
  1272. \end_layout
  1273. \begin_layout Standard
  1274. A study in 2006
  1275. \begin_inset CommandInset citation
  1276. LatexCommand cite
  1277. key "Nicolai2006"
  1278. \end_inset
  1279. used a similar technique to monitor the social context of the user, introducing
  1280. the idea of
  1281. \begin_inset Quotes eld
  1282. \end_inset
  1283. familiar
  1284. \begin_inset Quotes erd
  1285. \end_inset
  1286. people,
  1287. \begin_inset Quotes eld
  1288. \end_inset
  1289. unfamiliar
  1290. \begin_inset Quotes erd
  1291. \end_inset
  1292. people and
  1293. \begin_inset Quotes eld
  1294. \end_inset
  1295. familiar strangers
  1296. \begin_inset Quotes erd
  1297. \end_inset
  1298. .
  1299. These labels were applied based on the number of times their Bluetooth
  1300. devices were detected
  1301. \begin_inset Foot
  1302. status collapsed
  1303. \begin_layout Plain Layout
  1304. and by extension the number of times the user had come into contact with
  1305. them
  1306. \end_layout
  1307. \end_inset
  1308. .
  1309. While the definition of
  1310. \begin_inset Quotes eld
  1311. \end_inset
  1312. familiar
  1313. \begin_inset Quotes erd
  1314. \end_inset
  1315. and
  1316. \begin_inset Quotes eld
  1317. \end_inset
  1318. unfamiliar
  1319. \begin_inset Quotes erd
  1320. \end_inset
  1321. are quite obvious,
  1322. \begin_inset Quotes eld
  1323. \end_inset
  1324. familiar strangers
  1325. \begin_inset Quotes erd
  1326. \end_inset
  1327. is a new class of people used to describe those who the user encounters
  1328. repeatedly, but doesn't interact with.
  1329. This may include neighbours that are passed on the street, or fellow commuters
  1330. on a journey into work.
  1331. The number of people in each of those groups (and any changes in those
  1332. numbers) can be used to infer how
  1333. \begin_inset Quotes eld
  1334. \end_inset
  1335. comfortable
  1336. \begin_inset Quotes erd
  1337. \end_inset
  1338. the user feels with their social context, and whether their current activity
  1339. is part of a normal routine or is novel.
  1340. \end_layout
  1341. \begin_layout Standard
  1342. This research has, to date, not been readily combined with activity-aware
  1343. applications, and this project will aim to integrate the results of Bluetooth
  1344. scanning with
  1345. \begin_inset Quotes eld
  1346. \end_inset
  1347. classical
  1348. \begin_inset Quotes erd
  1349. \end_inset
  1350. activity classification techniques and to evaluate whether it provides
  1351. any benefit.
  1352. \end_layout
  1353. \begin_layout Section
  1354. Power management
  1355. \begin_inset CommandInset label
  1356. LatexCommand label
  1357. name "sec:Power-management"
  1358. \end_inset
  1359. \end_layout
  1360. \begin_layout Standard
  1361. One major consideration when deploying an application on a mobile device
  1362. is the amount of power it will use.
  1363. An application constantly polling any one sensor can reduce battery life
  1364. significantly, and an application which kept all available sensors active
  1365. (in addition to doing CPU-heavy analysis on them) would drain the battery
  1366. in a typical smartphone in a matter of hours.
  1367. A context-aware application is not very useful for a user if they can only
  1368. use their telephone for an hour or two before it needs recharging!
  1369. \end_layout
  1370. \begin_layout Standard
  1371. One solution
  1372. \begin_inset CommandInset citation
  1373. LatexCommand cite
  1374. key "Wang2009"
  1375. \end_inset
  1376. is to only use one or two sensors to monitor the user's activity until it
  1377. appears to be transitioning.
  1378. For example, if the user is believed to be walking, the application only
  1379. needs to periodically check either the accelerometer (to confirm the user
  1380. is still making walking motions) or GPS (to confirm the distance traveled
  1381. is still consistent with walking) to know that their activity has not changed.
  1382. As soon as the user's behaviour becomes inconsistent with walking, the
  1383. application can bring other sensors online until it has successfully reclassifi
  1384. ed the activity, and then resume monitoring with minimal sensors.
  1385. \end_layout
  1386. \begin_layout Standard
  1387. Another option
  1388. \begin_inset CommandInset citation
  1389. LatexCommand cite
  1390. key "Wang2009"
  1391. \end_inset
  1392. (which can be used in conjunction) is to only enable sensors for a short
  1393. amount of time, and then sleep for a period before reactivating them.
  1394. The
  1395. \begin_inset Quotes eld
  1396. \end_inset
  1397. duty cycle
  1398. \begin_inset Quotes erd
  1399. \end_inset
  1400. suggested for accelerometers is 6 second of sensing followed by 10 seconds
  1401. of sleeping.
  1402. The six second window is enough time to allow for capturing a full range
  1403. of motion (several complete strides) if the user is walking or running,
  1404. and then the ten second sleep stops the accelerometer using battery power
  1405. until the next cycle.
  1406. This process obviously means that a sudden switch in activity will not
  1407. be noticed immediately, but a delay of a few seconds is acceptable as most
  1408. activities will last for minutes or longer.
  1409. \end_layout
  1410. \begin_layout Standard
  1411. The battery life on modern smartphones rarely exceeds 24 hours of typical
  1412. use, so it is extremely important that any applications developed for this
  1413. project does not significantly reduce this.
  1414. A balance between prompt detection and notification of activity changes
  1415. and battery use by sensors and processing algorithms will need to be found.
  1416. \end_layout
  1417. \begin_layout Standard
  1418. \begin_inset Newpage pagebreak
  1419. \end_inset
  1420. \end_layout
  1421. \begin_layout Part
  1422. Accelerometer classification
  1423. \end_layout
  1424. \begin_layout Section
  1425. Sensor Logger application
  1426. \end_layout
  1427. \begin_layout Standard
  1428. The primary component of context that this project aims to expose is the
  1429. user's activity.
  1430. The main factor in determining a user's activity is the data retrieved
  1431. from the device's accelerometers.
  1432. This gave rise to the project's first published application, titled
  1433. \noun on
  1434. Sensor Logger
  1435. \noun default
  1436. .
  1437. The first version of
  1438. \noun on
  1439. Sensor Logger
  1440. \noun default
  1441. consisted of a single activity containing a large amount of text describing
  1442. the project, an editable text field where the user could name their activity,
  1443. and a button which initiated logging.
  1444. \end_layout
  1445. \begin_layout Standard
  1446. Once the user tapped the 'Start' button, the application launched a service
  1447. which registered with the device's SensorManager and requested fast updates
  1448. from both the accelerometer and the magnetic field sensor.
  1449. Every 50ms the last value received from each axis on each sensor was written
  1450. along with a timestamp to a file on the device.
  1451. After 1024 samples were collected (a total of around 51 seconds), the service
  1452. launched an uploader service and terminated itself.
  1453. The uploader service read the file from the device's flash memory, opened
  1454. a HTTP connection to the project website, and submitted the data to a PHP
  1455. script.
  1456. The PHP script in turn stored the data in a MySQL database.
  1457. \end_layout
  1458. \begin_layout Standard
  1459. \begin_inset Note Note
  1460. status open
  1461. \begin_layout Plain Layout
  1462. Market
  1463. \end_layout
  1464. \end_inset
  1465. \end_layout
  1466. \begin_layout Standard
  1467. \begin_inset Note Note
  1468. status open
  1469. \begin_layout Plain Layout
  1470. Diagram of components
  1471. \end_layout
  1472. \end_inset
  1473. \end_layout
  1474. \begin_layout Section
  1475. Manual classification
  1476. \end_layout
  1477. \begin_layout Standard
  1478. \begin_inset Note Note
  1479. status open
  1480. \begin_layout Plain Layout
  1481. Screenshot of window classifications
  1482. \end_layout
  1483. \end_inset
  1484. \end_layout
  1485. \begin_layout Standard
  1486. Once the sensor data was logged in the database, a web interface provided
  1487. a graphical representation of the acceleration and magnetic field readings.
  1488. It also allowed a handful of authenticated users to manually classify overlappi
  1489. ng
  1490. \begin_inset Quotes eld
  1491. \end_inset
  1492. windows
  1493. \begin_inset Quotes erd
  1494. \end_inset
  1495. of 128 data points.
  1496. These users could define activities in a hierarchical fashion, starting
  1497. with two root nodes - 'CLASSIFIED' and 'UNCLASSIFIED'.
  1498. Early data submitted resulted in a classification hierarchy of:
  1499. \end_layout
  1500. \begin_layout Itemize
  1501. UNCLASSIFIED
  1502. \end_layout
  1503. \begin_deeper
  1504. \begin_layout Itemize
  1505. PENDING (not yet manually assigned)
  1506. \end_layout
  1507. \begin_layout Itemize
  1508. UNKNOWN (unable to determine actual activity from user label)
  1509. \end_layout
  1510. \begin_layout Itemize
  1511. DNI (short for
  1512. \begin_inset Quotes eld
  1513. \end_inset
  1514. Do Not Include
  1515. \begin_inset Quotes erd
  1516. \end_inset
  1517. , for windows which appear erroneous)
  1518. \end_layout
  1519. \end_deeper
  1520. \begin_layout Itemize
  1521. CLASSIFIED
  1522. \end_layout
  1523. \begin_deeper
  1524. \begin_layout Itemize
  1525. WALKING
  1526. \end_layout
  1527. \begin_deeper
  1528. \begin_layout Itemize
  1529. STAIRS (not used in itself)
  1530. \end_layout
  1531. \begin_deeper
  1532. \begin_layout Itemize
  1533. UP
  1534. \end_layout
  1535. \begin_layout Itemize
  1536. DOWN
  1537. \end_layout
  1538. \end_deeper
  1539. \end_deeper
  1540. \begin_layout Itemize
  1541. IDLE (not used in itself)
  1542. \end_layout
  1543. \begin_deeper
  1544. \begin_layout Itemize
  1545. SITTING
  1546. \end_layout
  1547. \begin_layout Itemize
  1548. STANDING
  1549. \end_layout
  1550. \end_deeper
  1551. \begin_layout Itemize
  1552. VEHICLE (not used in itself)
  1553. \end_layout
  1554. \begin_deeper
  1555. \begin_layout Itemize
  1556. CAR
  1557. \end_layout
  1558. \begin_layout Itemize
  1559. BUS
  1560. \end_layout
  1561. \end_deeper
  1562. \begin_layout Itemize
  1563. DANCING
  1564. \end_layout
  1565. \end_deeper
  1566. \begin_layout Standard
  1567. It was observed that many samples had erroneous data either at the start
  1568. or the end of the recording.
  1569. This was a result of the user putting the device away in a pocket (as instructe
  1570. d) or picking it back up to check the results.
  1571. A classification of 'DNI', short for 'Do Not Include' was therefore introduced
  1572. which allowed the erroneous windows to be summarilary excluded from later
  1573. analysis.
  1574. Later iterations of the Sensor Logger application included a 10 second
  1575. delay at the start to give the user time to put the device away, and sounded
  1576. an audible alert at the end, which reduced the number of records submitted
  1577. with bad data.
  1578. \end_layout
  1579. \begin_layout Standard
  1580. Another problem with the user submitted data was that some activity descriptions
  1581. didn't make sense.
  1582. With the earliest versions of the Sensor Logger, a significant number of
  1583. users entered their own name or a non-sensical string into the textbox
  1584. labelled
  1585. \begin_inset Quotes eld
  1586. \end_inset
  1587. Activity name
  1588. \begin_inset Quotes erd
  1589. \end_inset
  1590. .
  1591. This suggested that users were either not reading or misunderstanding the
  1592. instructions.
  1593. A classification for 'UNKNOWN' was introduced to facilitate removal of
  1594. the records where classifications couldn't be inferred from the activity
  1595. name.
  1596. \end_layout
  1597. \begin_layout Section
  1598. Feature extraction
  1599. \end_layout
  1600. \begin_layout Standard
  1601. Once a reasonable sample of data had been recorded, the PHP script was modified
  1602. to allow exporting of all classified windows.
  1603. It produced a plain text file containing the sensor readings and timestamp
  1604. for each of the 128 points in each window, as well as the manually-applied
  1605. classification.
  1606. It did not include information as to which windows were from the same sample,
  1607. or the orginal user-supplied activity name.
  1608. \begin_inset Note Note
  1609. status open
  1610. \begin_layout Plain Layout
  1611. Sample in appendix
  1612. \end_layout
  1613. \end_inset
  1614. \end_layout
  1615. \begin_layout Standard
  1616. A Java program was written which imported the exported data.
  1617. A series of 'feature extractors' were written.
  1618. These included the range, minimum, median, mean, maximum and absolute mean
  1619. \begin_inset Note Note
  1620. status open
  1621. \begin_layout Plain Layout
  1622. explain
  1623. \end_layout
  1624. \end_inset
  1625. .
  1626. Each of these was calculated over the set of 128 data points from each
  1627. axis on each sensor, giving a total of 36 features.
  1628. Before initial tests with these features were performed, it was planned
  1629. to add further features including fast fourier transforms and energy, as
  1630. suggested by multiple papers consulted in background research.
  1631. \end_layout
  1632. \begin_layout Standard
  1633. The program was modified to export the features and classification of each
  1634. window in ARFF
  1635. \begin_inset Note Note
  1636. status open
  1637. \begin_layout Plain Layout
  1638. ref
  1639. \end_layout
  1640. \end_inset
  1641. (Attribute Relation File Format).
  1642. This is a format used by Weka
  1643. \begin_inset Note Note
  1644. status open
  1645. \begin_layout Plain Layout
  1646. ref
  1647. \end_layout
  1648. \end_inset
  1649. , a popular data mining suite developed by the University of Waikato.
  1650. \begin_inset Note Note
  1651. status open
  1652. \begin_layout Plain Layout
  1653. Sample in appendix
  1654. \end_layout
  1655. \end_inset
  1656. The ARFF file was imported into Weka and analysed.
  1657. \end_layout
  1658. \begin_layout Standard
  1659. It was found that Weka could correctly classified
  1660. \begin_inset Note Note
  1661. status open
  1662. \begin_layout Plain Layout
  1663. 99%
  1664. \end_layout
  1665. \end_inset
  1666. of activities (measured using a
  1667. \begin_inset Note Note
  1668. status open
  1669. \begin_layout Plain Layout
  1670. hold-one cross validation
  1671. \end_layout
  1672. \end_inset
  1673. ) using a K-Nearest Network algorithm with K = 1.
  1674. Furthermore, it became apparent that the error did not significantly increase
  1675. when the 36 features were reduced to just four - the absolute mean and
  1676. the range of the Y and Z accelerometer readings.
  1677. Given the low cost of calculating these features and the very high detection
  1678. rate, further research into other features such as FFTs was not performed.
  1679. \end_layout
  1680. \begin_layout Standard
  1681. The application was again modified to read the exported data, calculate
  1682. the four interesting features, and create a mapping of data points to activity.
  1683. This map was then serialised and written to a file
  1684. \begin_inset Note Note
  1685. status open
  1686. \begin_layout Plain Layout
  1687. expand
  1688. \end_layout
  1689. \end_inset
  1690. .
  1691. \end_layout
  1692. \begin_layout Section
  1693. On-device classification
  1694. \end_layout
  1695. \begin_layout Standard
  1696. The serialised model was bundled with a new version of the Sensor Logger
  1697. application, along with a completely redesigned user interface.
  1698. The application now consisted of a series of activities: on opening the
  1699. application, the user is presented with an introduction activity which
  1700. explains what the application does and the aims of the project; when they
  1701. click the 'next' button a 10 second countdown is displayed with the instruction
  1702. to put the phone away repeated.
  1703. During the data collection period an animated pattern of dots is displayed
  1704. so the user knows the application is still working if they look at it.
  1705. When data collection is completed, the device adds a notification with
  1706. sound and vibrate settings, and displays another progress screen while
  1707. a background service analyses the data.
  1708. The result of the classification is then displayed prominently and the
  1709. user is presented with two buttons - one to confirm the classification
  1710. and one to reject and correct it.
  1711. The on-device classification (and any correction made to it) is submitted
  1712. along with all the data previously submitted.
  1713. The user is then presented with a 'Thank you' message, and a unique link
  1714. to the project website where they can view graphs of their activities.
  1715. \begin_inset Note Note
  1716. status open
  1717. \begin_layout Plain Layout
  1718. Mess!
  1719. \end_layout
  1720. \end_inset
  1721. \end_layout
  1722. \begin_layout Section
  1723. Activity Recorder application
  1724. \end_layout
  1725. \begin_layout Standard
  1726. The Activity Recorder application was the second application published on
  1727. the market.
  1728. In contrast to the sensor logger, it only records the two relevant axes
  1729. of the accelerometer, and all data is kept in memory
  1730. \begin_inset Note Note
  1731. status open
  1732. \begin_layout Plain Layout
  1733. on the heap?
  1734. \end_layout
  1735. \end_inset
  1736. instead of being written to a file.
  1737. \end_layout
  1738. \begin_layout Standard
  1739. The activity recorder consists of a background service which records 128
  1740. samples of sensor data once every 30 seconds.
  1741. At all other times, the accelerometer is not accessed to conserve battery
  1742. power.
  1743. The samples are then classified using the same model as the Sensor Logger
  1744. application, and the resulting activity is appended to a list.
  1745. \begin_inset Note Note
  1746. status open
  1747. \begin_layout Plain Layout
  1748. Adjacent
  1749. \end_layout
  1750. \end_inset
  1751. samples which are classified as the same activity are merged together.
  1752. \end_layout
  1753. \begin_layout Standard
  1754. The user interface displays a list of activities, along with their start
  1755. time and duration in minutes or hours.
  1756. \end_layout
  1757. \begin_layout Part
  1758. Microphone, camera and Bluetooth
  1759. \end_layout
  1760. \begin_layout Part
  1761. Places
  1762. \end_layout
  1763. \begin_layout Part
  1764. The Context Analyser applications
  1765. \end_layout
  1766. \begin_layout Standard
  1767. \begin_inset Newpage pagebreak
  1768. \end_inset
  1769. \end_layout
  1770. \begin_layout Part
  1771. Evaluation
  1772. \end_layout
  1773. \begin_layout Section
  1774. Reports
  1775. \end_layout
  1776. \begin_layout Standard
  1777. The results of the experimentation described in section
  1778. \begin_inset CommandInset ref
  1779. LatexCommand ref
  1780. reference "sec:Experimentation"
  1781. \end_inset
  1782. should be written up as a report.
  1783. The reports must include the data collected in each of the experiments,
  1784. the conclusions drawn from those, and the impact of the results of the
  1785. experiment on the project deliverables.
  1786. \end_layout
  1787. \begin_layout Section
  1788. Deliverables
  1789. \end_layout
  1790. \begin_layout Standard
  1791. On successful completion of the project, there should be three deliverable
  1792. applications as specified in section
  1793. \begin_inset CommandInset ref
  1794. LatexCommand ref
  1795. reference "sec:Deliverables"
  1796. \end_inset
  1797. .
  1798. These can be tested and evaluated in a variety of manners:
  1799. \end_layout
  1800. \begin_layout Subsection
  1801. Unit tests
  1802. \end_layout
  1803. \begin_layout Standard
  1804. Throughout the development of the project, unit tests should be created
  1805. to test key functionality of all applications.
  1806. It is expected that at the completion of the project, all unit tests should
  1807. pass successfully, and they will have a code coverage of 80% or above.
  1808. \end_layout
  1809. \begin_layout Subsection
  1810. System tests
  1811. \end_layout
  1812. \begin_layout Standard
  1813. The classifier application should also have a suite of system tests.
  1814. These should consist of a set of fake or pre-recorded inputs which are
  1815. fed into the application in place of raw sensor data.
  1816. The output of the classifier (via the API) can then be compared to expected
  1817. output for the data.
  1818. \end_layout
  1819. \begin_layout Subsection
  1820. User acceptance testing
  1821. \end_layout
  1822. \begin_layout Standard
  1823. The Locale addon and context-aware home screen should be subject to user
  1824. acceptance testing for evaluation.
  1825. This should take the form of providing the applications to multiple end
  1826. users, allowing them to use them for a period of time (providing instructions
  1827. for certain tasks to complete).
  1828. The users should then be presented with a questionnaire which they can
  1829. use to evaluate the functionality, utility and design of the applications.
  1830. \end_layout
  1831. \begin_layout Subsubsection
  1832. Android market
  1833. \end_layout
  1834. \begin_layout Standard
  1835. In addition to providing the applications to a closed set of users, the
  1836. applications should be published to the Android market.
  1837. This will allow any owner of a compatible Android device to download and
  1838. use the applications.
  1839. The market also allows users to rate the application and leave comments,
  1840. which will be an extremely useful method of evaluating the success of the
  1841. applications.
  1842. \end_layout
  1843. \begin_layout Standard
  1844. As part of this, the classifier application/framework will be published,
  1845. and should include instructions for developers detailing how they can make
  1846. their applications context-aware.
  1847. The interest expressed and number of applications which use it (if any)
  1848. will be an indicator of the effectiveness of the API and its documentation.
  1849. \end_layout
  1850. \begin_layout Subsection
  1851. Classification scope
  1852. \end_layout
  1853. \begin_layout Standard
  1854. The classifier should be able to classify the following activities:
  1855. \end_layout
  1856. \begin_layout Itemize
  1857. walking
  1858. \end_layout
  1859. \begin_layout Itemize
  1860. running
  1861. \end_layout
  1862. \begin_layout Itemize
  1863. standing
  1864. \end_layout
  1865. \begin_layout Itemize
  1866. sitting
  1867. \end_layout
  1868. \begin_layout Itemize
  1869. traveling in a vehicle
  1870. \end_layout
  1871. \begin_layout Standard
  1872. These should be evaluated by means of a leave-one-out cross-validation test,
  1873. with data collected from one or more users and annotated by hand.
  1874. It is expected that the classifier should correctly classify all activities
  1875. with an accuracy of at least 70%, within 30 seconds of the activity being
  1876. started.
  1877. \end_layout
  1878. \begin_layout Subsection
  1879. Resource usage
  1880. \end_layout
  1881. \begin_layout Standard
  1882. Finally, the applications should be evaluated based on their resource usage.
  1883. One of the main concerns will be battery usage (caused both by the application
  1884. using processor time, and activating sensors), but attention must also
  1885. be paid to memory consumption (especially after extended use).
  1886. The goal should be to ensure that the resource usage of the applications
  1887. in this project do not adversely impact the functionality of the device;
  1888. that is, battery life should not be reduced so significantly that it requires
  1889. users to change their normal charging behaviour, and memory usage should
  1890. not be so high as to cause other applications to become sluggish or be
  1891. closed by the operating system.
  1892. \end_layout
  1893. \begin_layout Standard
  1894. \begin_inset Newpage pagebreak
  1895. \end_inset
  1896. \end_layout
  1897. \begin_layout Part
  1898. Conclusion
  1899. \end_layout
  1900. \begin_layout Standard
  1901. \begin_inset Newpage pagebreak
  1902. \end_inset
  1903. \end_layout
  1904. \begin_layout Part
  1905. Appendices
  1906. \end_layout
  1907. \begin_layout Section
  1908. \start_of_appendix
  1909. User Guide - Context Analyser
  1910. \end_layout
  1911. \begin_layout Standard
  1912. Welcome to the
  1913. \noun on
  1914. Context Analyser
  1915. \noun default
  1916. .
  1917. This application analyses your
  1918. \emph on
  1919. context
  1920. \emph default
  1921. as you carry your phone around with you performing day-to-day activities.
  1922. Other applications can query your context information and enhance their
  1923. behaviour so that they're more relevant to what you're doing.
  1924. \end_layout
  1925. \begin_layout Standard
  1926. The context analyser currently provides the following context information:
  1927. \end_layout
  1928. \begin_layout Itemize
  1929. Your activity
  1930. \end_layout
  1931. \begin_layout Itemize
  1932. Your location
  1933. \end_layout
  1934. \begin_layout Itemize
  1935. Your predicted destination, if you're not at a known location
  1936. \end_layout
  1937. \begin_layout Standard
  1938. It does this by gathering data from your phone's accelerometers and location
  1939. provider.
  1940. Data is recorded for a few seconds once a minute, to preserve your battery
  1941. life.
  1942. \end_layout
  1943. \begin_layout Standard
  1944. For your 'activity', the context analyser tries to detect whether you are
  1945. walking, sitting, standing, or in a vehicle.
  1946. It can also expand on these to detect the difference between a car and
  1947. a bus, and walking normally and walking up or down stairs.
  1948. Future updates may add more activities.
  1949. \end_layout
  1950. \begin_layout Standard
  1951. For your location and destination, the context analyser deals in 'places'.
  1952. These are locations up to 500m wide where you have spent several minutes
  1953. not moving.
  1954. A place could correspond to your home, office, favourite coffee shop or
  1955. a bus stop you frequently wait at.
  1956. When you move between places, the context analyser notes which activities
  1957. it thought you were performing, and stores these as a 'journey' which links
  1958. the two places.
  1959. When you next set off from one of these, it can compare your activities
  1960. and see if it can guess where you're heading.
  1961. \end_layout
  1962. \begin_layout Standard
  1963. There is very little you can do with the context analyser on its own.
  1964. It's built as a tool for other applications to hook into.
  1965. \begin_inset Float figure
  1966. wide false
  1967. sideways false
  1968. status collapsed
  1969. \begin_layout Plain Layout
  1970. \begin_inset Graphics
  1971. filename contextanalyser-featured.png
  1972. \end_inset
  1973. \end_layout
  1974. \begin_layout Plain Layout
  1975. \begin_inset Caption
  1976. \begin_layout Plain Layout
  1977. Featured applications
  1978. \begin_inset CommandInset label
  1979. LatexCommand label
  1980. name "fig:Featured-applications"
  1981. \end_inset
  1982. \end_layout
  1983. \end_inset
  1984. \end_layout
  1985. \end_inset
  1986. You can see some of these featured applications listed when you open the
  1987. context analyser (see
  1988. \begin_inset CommandInset ref
  1989. LatexCommand prettyref
  1990. reference "fig:Featured-applications"
  1991. \end_inset
  1992. ) .
  1993. Simply click on one of them and the Android market will open for you to
  1994. view or install your chosen app.
  1995. \end_layout
  1996. \begin_layout Standard
  1997. \begin_inset Float figure
  1998. wide false
  1999. sideways false
  2000. status collapsed
  2001. \begin_layout Plain Layout
  2002. \begin_inset Graphics
  2003. filename contextanalyser-menu.png
  2004. \end_inset
  2005. \begin_inset Caption
  2006. \begin_layout Plain Layout
  2007. Disable service button
  2008. \begin_inset CommandInset label
  2009. LatexCommand label
  2010. name "fig:Disable-service-button"
  2011. \end_inset
  2012. \end_layout
  2013. \end_inset
  2014. \end_layout
  2015. \end_inset
  2016. The context analyser will run a background service as soon as you open the
  2017. application, or whenever another application requests data from it.
  2018. If you wish to disable the background service (which will stop the context
  2019. analyser from detecting places or determining your activity), press the
  2020. \noun on
  2021. menu
  2022. \noun default
  2023. button and select the
  2024. \noun on
  2025. Disable service
  2026. \noun default
  2027. option (see
  2028. \begin_inset CommandInset ref
  2029. LatexCommand prettyref
  2030. reference "fig:Disable-service-button"
  2031. \end_inset
  2032. ).
  2033. The background service will not run until you repeat the procedure and
  2034. select
  2035. \noun on
  2036. Enable service
  2037. \noun default
  2038. .
  2039. \end_layout
  2040. \begin_layout Section
  2041. User Guide - Places
  2042. \end_layout
  2043. \begin_layout Standard
  2044. The
  2045. \noun on
  2046. places
  2047. \noun default
  2048. application shows you all of the places detected by the
  2049. \noun on
  2050. Context Analyser
  2051. \noun default
  2052. , and the journeys you make in between them.
  2053. The
  2054. \noun on
  2055. Context Analyser
  2056. \noun default
  2057. is a tool which tries to determine your current activity and location,
  2058. and your destination if you're on the move.
  2059. If you don't have the
  2060. \noun on
  2061. Context Analyser
  2062. \noun default
  2063. installed, you'll be prompted to install it from the market.
  2064. \end_layout
  2065. \begin_layout Standard
  2066. \begin_inset Float figure
  2067. wide false
  2068. sideways false
  2069. status collapsed
  2070. \begin_layout Plain Layout
  2071. \begin_inset Graphics
  2072. filename places-normal.png
  2073. \end_inset
  2074. \end_layout
  2075. \begin_layout Plain Layout
  2076. \begin_inset Caption
  2077. \begin_layout Plain Layout
  2078. Places application
  2079. \begin_inset CommandInset label
  2080. LatexCommand label
  2081. name "fig:Places-application"
  2082. \end_inset
  2083. \end_layout
  2084. \end_inset
  2085. \end_layout
  2086. \begin_layout Plain Layout
  2087. \end_layout
  2088. \end_inset
  2089. The places application displays a map and marks each detected place with
  2090. an orange star.
  2091. Places you've travelled between are connected with a red line - the thicker
  2092. the line, the more frequently you make that journey.
  2093. In
  2094. \begin_inset CommandInset ref
  2095. LatexCommand prettyref
  2096. reference "fig:Places-application"
  2097. \end_inset
  2098. , you can see two places with a very frequently made journey between them.
  2099. \end_layout
  2100. \begin_layout Standard
  2101. You can pan the map by dragging it around with your finger, or by moving
  2102. your phone's trackball (if it has one).
  2103. To zoom in and out, tap the screen and wait two seconds and the zoom controls
  2104. will appear at the bottom of the map.
  2105. Simply tap either button to zoom in or out.
  2106. \end_layout
  2107. \begin_layout Standard
  2108. \begin_inset Float figure
  2109. wide false
  2110. sideways false
  2111. status collapsed
  2112. \begin_layout Plain Layout
  2113. \begin_inset Graphics
  2114. filename places-toast.png
  2115. \end_inset
  2116. \end_layout
  2117. \begin_layout Plain Layout
  2118. \begin_inset Caption
  2119. \begin_layout Plain Layout
  2120. Place details
  2121. \begin_inset CommandInset label
  2122. LatexCommand label
  2123. name "fig:Place-details"
  2124. \end_inset
  2125. \end_layout
  2126. \end_inset
  2127. \end_layout
  2128. \begin_layout Plain Layout
  2129. \end_layout
  2130. \end_inset
  2131. To see more information about a place, simply tap on its star.
  2132. A small
  2133. \emph on
  2134. toast
  2135. \emph default
  2136. will appear giving you the name of the place, the number of visits, and
  2137. the date and time of your last visit.
  2138. Names are determined automatically by geocoding the latitude and longitude
  2139. to a nearby place name - this could be the name of a street, a nearby landmark
  2140. or a side alley.
  2141. \begin_inset CommandInset ref
  2142. LatexCommand prettyref
  2143. reference "fig:Place-details"
  2144. \end_inset
  2145. shows the result of tapping one of the stars - the name of the place is
  2146. \begin_inset Quotes eld
  2147. \end_inset
  2148. Rose Alley
  2149. \begin_inset Quotes erd
  2150. \end_inset
  2151. , it has been visited 37 times and the last time this happened was in the
  2152. early hours of July the 10th.
  2153. \end_layout
  2154. \begin_layout Standard
  2155. \begin_inset Newpage pagebreak
  2156. \end_inset
  2157. \begin_inset CommandInset bibtex
  2158. LatexCommand bibtex
  2159. bibfiles "/home/chris/Uni/project/papers/project"
  2160. options "bibtotoc,savetrees"
  2161. \end_inset
  2162. \end_layout
  2163. \end_body
  2164. \end_document