scieee Science in your language
[en] (orig)

Exploring the Capabilities of Deep Learning Models for Transport and Human Activity Recognition

Abstract

This thesis explores the transformative potential of deep learning smartphone-based transportation mode detection systems in enhancing urban planning in the city of Barcelona. The core of this thesis is the development and comparison of algorithms, coupled with extensive data analysis and preprocessing techniques, aimed at reliable transport mode detection. We delve into creating a real-time system capable of predicting transport usage patterns. For that, a dataset of smartphone sensor data has been created with examples of journeys using multiple modes of transportation in the metropolitan area of Barcelona. In the deep learning model, we have experimented with architectures combining convolutional networks and LSTMs to finally create a hierarchical model that combines the use of CNNs for feature extraction, with the ability to process time series from the LSTM layers using skip connections. For robust and battery-efficient detection, we have combined this model with statistical techniques, which allow us to detect at an early stage whether the user is moving, standing or walking. This allows not to make excessive use of the deep learning model, which can be costly in mobile devices. Following, an android application is presented which implements the mentioned techniques and presents a simple way to collect mobility data, which can be useful for future studies on urban mobility in the city. Finally, the various ethical, social and environmental issues that such systems may have are studied, describing the privacy and interpretability factors that this tools must comply with.

Read accessible full text

Exploring the Capabilities of Deep Learning Models for Transport and Human Activity Recognition

Author: Caravaca Ibáñez, Gerard
Publisher: Universitat Politècnica de Catalunya
Year: 2024
Source: https://upcommons.upc.edu/bitstream/2117/400780/5/TFM-Gerard-Caravaca_fitxer%20de%20consulta.pdf
id182802


EXPLORING THE CAPABILITIES OF DEEP
LEARNING MODELS FOR TRANSPORT AND
HUMAN ACTIVITY RECOGNITION
GERARD CARAVACA IBÁÑEZ
Thesis supe iso : MÓNICAAGUILARIGARTUA
Tu o :JAVIERBÉJARALONSO(Depa men o Compu e Science)
Deg ee:Mas e 'sDeg eeinA i icialIn elligence
Mas e 's hesis
School o Enginee ing
Uni e si a Ro i a i Vi gili (URV)
Facul y o Ma hema ics
Uni e si a de Ba celona (UB)
Ba celona School o In o ma ics (FIB)
Uni e si a Poli ècnica de Ca alunya (UPC) - Ba celonaTech
23/01/2024

i
Abs ac
This hesis explo es he ans o ma i e po en ial o deep lea ning sma phone-based ans-
po a ion mode de ec ion sys ems in enhancing u ban planning in he ci y o Ba celona.
The co e o his hesis is he de elopmen and compa ison o algo i hms, coupled wi h
ex ensi e da a analysis and p ep ocessing echniques, aimed a eliable anspo mode
de ec ion. We del e in o c ea ing a eal- ime sys em capable o p edic ing anspo usage
pa e ns. Fo ha , a da ase o sma phone senso da a has been c ea ed wi h examples
o jou neys using mul iple modes o anspo a ion in he me opoli an a ea o Ba celona.
In he deep lea ning model, we ha e expe imen ed wi h a chi ec u es combining con o-
lu ional ne wo ks and LSTMs o inally c ea e a hie a chical model ha combines he use
o CNNs o ea u e ex ac ion, wi h he abili y o p ocess ime se ies om he LSTM lay-
e s using skip connec ions. Fo obus and ba e y-e icien de ec ion, we ha e combined
his model wi h s a is ical echniques, which allow us o de ec a an ea ly s age whe he
he use is mo ing, s anding o walking. This allows no o make excessi e use o he
deep lea ning model, which can be cos ly in mobile de ices. Following, an and oid ap-
plica ion is p esen ed which implemen s he men ioned echniques and p esen s a simple
way o collec mobili y da a, which can be use ul o u u e s udies on u ban mobili y in
he ci y. Finally, he a ious e hical, social and en i onmen al issues ha such sys ems
may ha e a e s udied, desc ibing he p i acy and in e p e abili y ac o s ha his ools
mus comply wi h.
Index e ms - Ac i i y ecogni ion, deep lea ning, mobile senso s, anspo a ion mode de ec ion,
u ban mobili y, Mobili App.
ii
Acknowledgemen s
I would like o exp ess my since e g a i ude o all hose who ha e suppo ed and guided
me h oughou he jou ney o his hesis.
Fi s and o emos , my hea el hanks o my supe iso , P o esso Mónica Aguila , o
gi ing me he oppo uni y o wo k on his p ojec and o guiding me du ing hese
mon hs. Addi ionally, I am p o oundly hank ul o he membe s o he SISCOM g oup
and all he s udy olun ee s. Thei willingness o sha e hei ime and da a was indis-
pensable. This esea ch simply would no ha e been achie able wi hou hei in aluable
con ibu ions.
I would also like o hank P o esso Ja ie Béja o his aluable eedback. His expe -
ise g ea ly in luenced my esea ch. My g a i ude ex ends o he acul y and s a a he
Facul a de In o mà ica de Ba celona (FIB). Thei suppo and he oppo uni ies p o ided
ha e been i al in enhancing my esea ch expe ience, bo h in he bachelo ’s and mas e ’s
deg ees. The en i onmen he e has been bo h challenging and inspi ing.
On a pe sonal no e, I ex end my deepes g a i ude o my amily o hei elen less lo e
and suppo . They ha e been a cons an sou ce o inspi a ion and s eng h h oughou
his jou ney. Addi ionally, I am immensely hank ul o my iends o hei inc edible
suppo and encou agemen .
Finally, I acknowledge Au o i a del T anspo Me opoli à (ATM) o hei suppo and
eedback, which was essen ial o comple ing his p ojec
iii
Con en s
Abs ac i
Acknowledgemen s ii
Lis o Figu es
Lis o Tables ii
In oduc ion 1
1 P elimina y 2
1.1 Con ex ....................................... 2
1.2 Mo i a ion and esea ch objec i es . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Me hodologyo e iew.............................. 3
2 Fundamen al knowledge 5
2.1 U ban mobili y in Ba celona . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.1.1 Fu u e o Mobili y in Ba celona . . . . . . . . . . . . . . . . . . . . . 7
2.1.2 Ou ole in u ban mobili y o Ba celona . . . . . . . . . . . . . . . . 7
2.2 T anspo mode ecogni ion ask . . . . . . . . . . . . . . . . . . . . . . . . 8
2.2.1 Applica ions o anspo mode ecogni ion ask . . . . . . . . . . . 8
2.2.2 Challenges o anspo mode ecogni ion ask . . . . . . . . . . . . 8
2.3 T adi ional machine lea ning echniques . . . . . . . . . . . . . . . . . . . . 10
2.3.1 Suppo Vec o Machines (SVM) . . . . . . . . . . . . . . . . . . . . 10
2.3.2 K-Nea es Neighbo s (KNN) . . . . . . . . . . . . . . . . . . . . . . 11
2.3.3 Random Fo es (RF) . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.4 Deep lea ning echniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4.1 Mul ilaye pe cep on . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4.2 Con olu ional Neu al Ne wo ks (CNN) . . . . . . . . . . . . . . . . 14
2.4.3 Dila edCNN ............................... 15
2.4.4 Recu en Neu al Ne wo ks (RNN) . . . . . . . . . . . . . . . . . . 15
2.4.5 Long sho - e m memo y (LSTM) . . . . . . . . . . . . . . . . . . . 17
2.4.6 Bidi ec ional LSTM (Bi-LSTM) . . . . . . . . . . . . . . . . . . . . . 18
2.4.7 A en ion mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2.4.8 T ans o me s ............................... 21
2.4.9 T ans o me s in T anspo mode ecogni ion . . . . . . . . . . . . . 22
2.5 Pe o mancee alua ion ............................. 22
2.5.1 Pe o mance Me ics . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.5.2 Con usionMa ix............................. 23
Con en s i
2.5.3 Lea ningCu es ............................. 24
2.5.4 G oup k- old c oss- alida ion . . . . . . . . . . . . . . . . . . . . . . 24
2.6 Da a acquisi ion modali ies . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.6.1 Mo ion modali y o anspo mode ecogni ion . . . . . . . . . . . 25
Ad an ages o mo ion modali y o anspo mode ecogni ion . . 26
D awbacks o mo ion modali y o anspo mode ecogni ion . . 26
2.6.2 Loca ion modali y o anspo mode ecogni ion . . . . . . . . . . 28
Ad an ages o loca ion modali y o anspo mode ecogni ion . 28
D awbacks o loca ion modali y o anspo mode ecogni ion . . 28
2.6.3 Ambien modali y o anspo mode ecogni ion . . . . . . . . . . 28
Ad an ages o ambien modali y o anspo mode ecogni ion . 29
D awbacks o ambien modali y o anspo mode ecogni ion . . 29
3 Backg ound 31
3.1 Keycon ibu ions................................. 31
3.1.1 T adi ional p oposals . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Hemminkie Al. ............................. 31
Manzonie Al............................... 32
Nhame Al................................. 32
B ezmese Al................................ 32
Ra i e Al. and Kwapisz e Al. . . . . . . . . . . . . . . . . . . . . . 32
Rosenbe g Randle e Al. . . . . . . . . . . . . . . . . . . . . . . . . 33
3.1.2 Recen con ibu ions . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Gjo eskie Al................................ 33
Mu ade Al................................. 33
Oki ae Al. ................................ 33
Songe Al.................................. 33
Jeyakuma e Al. ............................. 34
3.2 Da aa ailabili y.................................. 34
3.2.1 Sussex-Huawei Locomo ion Da ase (SHL) . . . . . . . . . . . . . . 34
Ad an ages o he SHL da ase . . . . . . . . . . . . . . . . . . . . . 36
Limi a ions o he SHL da ase . . . . . . . . . . . . . . . . . . . . . 36
3.2.2 T anspo Mode De ec ion Da ase (TMD) . . . . . . . . . . . . . . . 37
Ad an ages o he TMD da ase . . . . . . . . . . . . . . . . . . . . 38
Limi a ions o he TMD da ase . . . . . . . . . . . . . . . . . . . . . 38
3.2.3 Collec yDa ase .............................. 39
Ad an ages o he Collec y da ase . . . . . . . . . . . . . . . . . . . 40
Limi a ions o he Collec y da ase . . . . . . . . . . . . . . . . . . . 40
4 Ou u ban mobili y da ase 41
5 Model expe imen a ion and e inemen 42
5.1 F amewo kde ini ion .............................. 42
5.1.1 S a ingpoin ............................... 42
Ini ialp ep ocessing ........................... 43
Ini ialse ssepa a ion........................... 43
Ini ial model a chi ec u e . . . . . . . . . . . . . . . . . . . . . . . . 43
5.1.2 E ec s o se s sepa a ion algo i hm . . . . . . . . . . . . . . . . . . . 44

Con en s
5.1.3 E ec s o window size and o e lapping ac o . . . . . . . . . . . . 46
5.1.4 E ec s o da a augmen a ion . . . . . . . . . . . . . . . . . . . . . . 47
5.1.5 E ec s o smoo hing echnique . . . . . . . . . . . . . . . . . . . . . 49
5.1.6 E ec s o ou lie elimina ion . . . . . . . . . . . . . . . . . . . . . . 51
5.1.7 Final con igu a ion o he baseline model . . . . . . . . . . . . . . . 52
5.2 T adi ional machine lea ning baselines . . . . . . . . . . . . . . . . . . . . . 53
5.3 BiLSTM....................................... 55
5.4 Mixedmodel.................................... 56
5.4.1 Regula iza ion .............................. 58
5.4.2 Con olu ional Block Va ia ions . . . . . . . . . . . . . . . . . . . . . 60
5.4.3 Ac i a ion Func ion Tuning . . . . . . . . . . . . . . . . . . . . . . . 61
5.4.4 Recu en Block Va ia ions . . . . . . . . . . . . . . . . . . . . . . . 62
5.5 Hie a chicalmodel ................................ 64
5.6 T ans e lea ning ................................. 67
5.7 Resul sdiscussion................................. 70
5.7.1 Final Hie a chical model e alua ion . . . . . . . . . . . . . . . . . . 73
6 Mobili App ool o ecogni ion o anspo a ion modes 75
7 E hical and en i onmen al conce ns 76
7.1 E hicalconside a ions .............................. 76
7.1.1 P i acy................................... 76
7.1.2 In e p e abili y .............................. 77
7.1.3 Secu i y .................................. 78
7.2 En i onmen alimpac .............................. 78
8 Conclusions and Fu u e wo k 80
i
Lis o Figu es
1.1 Na ional and in e na ional o ganiza ions ha suppo he p ojec . . . . . . 3
2.1 Numbe o use s (millions) o each public anspo pe qua e in Ba celona
(2016- 2021). [16] ................................. 6
2.2 Ca ego ies o deep lea ning in senso based human ac i i y ecogni ion
challenges, also applicable o anspo mode ecogni ion. [14]....... 9
2.3 Example o a linea ly sepa able p oblem sol ed by a SVM. [49] . . . . . . 10
2.4 Visualiza ion o he KNN algo i hm applied o he I is da ase . [49] . . . . 11
2.5 Rep esen a ion o a mul ilaye pe cep on wi h wo hidden laye s. [22] . . 13
2.6 (a) The a chi ec u e o he LeNe -5 ne wo k. (b) Visualiza ion o ea u es
in he LeNe -5 ne wo k. Each laye ’s ea u e maps a e displayed in a di -
e en block. [8] .................................. 14
2.7 Example s uc u e o empo al ea u e ex ac ion applying 1D con olu-
ional laye s. [14] ................................. 15
2.8 (a) 1-dila ed con olu ion; each elemen has a ecep i e ield o 3×3. (b) 2-
dila ed con olu ion; each elemen has a ecep i e ield o 7×7. (c) 4-dila ed
con olu ion; each elemen has a ecep i e ield o 15×15. [64]........ 15
2.9 Diag am o a 3-laye ecu en neu al ne wo k. [27] ............. 16
2.10 Compa ison o a RNN cell (abo e) and an LSTM cell (below). [55] . . . . . 17
2.11 LSTM cell s uc u e. [55]............................. 18
2.12 LSTM-based a chi ec u e example o ex ac ing empo al ea u es om
senso signals. [14] ................................ 18
2.13 Bi-LSTM s uc u e applied o NLP [7]...................... 19
2.14 Scaled Do -P oduc A en ion mechanism [59]. ................ 20
2.15 Mul ihead a en ion block [59]. ......................... 21
2.16 The T ans o me - model a chi ec u e. [59] .................. 22
2.17 Con usion ma ix’s simple example [23]..................... 24
2.18 Bias and a iance ep esen ed in an e o ’s lea ning cu e [23]. . . . . . . 24
2.19 Axis di ec ions o he accele ome e o he sma phones. [9]........ 27
2.20 Axis di ec ions o he gy oscope o he sma phones. [9] .......... 27
2.21 Func ioning o he sma phone magne ome e . [9] .............. 27
2.22 Example o he use o RSS echnology in indoo spaces [39]. ........ 30
3.1 A chi ec u e p oposed by Hemminki e Al. [29]. ............... 31
3.2 Cumula i e du a ion in hou s o each ac i i y in he SHL da ase . [60] . . 35
3.3 Posi ioning o he de ice in he da a collec ion p ocess. [60]......... 36
3.4 P ep ocessing s eps on he TMD da ase . [13]................. 38
3.5 Collec y da ase dis ibu ion. [19]........................ 40
Lis o Figu es ii
5.1 LSTM baseline a qui ec u e. . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
5.2 T aining and alida ion use s dis ibu ion a e applying he andom spli
con igu a ion. ................................... 44
5.3 T aining and alida ion use dis ibu ion a e applying he di e en use s
spli con igu a ion. ................................ 45
5.4 O iginal da ase dis ibu ion, wi hou da a augmen a ion. . . . . . . . . . 47
5.5 Class dis ibu ion in he da ase augmen ed using wo a ia ions o da a
augmen a ion echniques. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
5.6 Visualiza ion o he e ec s o Gaussian Smoo hing echnique wi h sigma=1,
inaCa sample................................... 50
5.7 Lea ning cu es h oughou he di e en epochs o he model ained us-
ing he inal con igu a ion. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.8 Con usion ma ix o he model ained using he inal con igu a ion. . . . 53
5.9 Con usion ma ix o he p esen ed MLP model. . . . . . . . . . . . . . . . . 55
5.10 Lea ning cu es h oughou he di e en epochs o he BiLSTM model
ained using he uned op imiza ion pa ame e s. . . . . . . . . . . . . . . 56
5.11 Base a chi ec u e diag am o he mixed model combining LSTM and CNNs. 57
5.12 Lea ning cu es h oughou he di e en epochs o he mixed model ained
using using a d opou a e o 20%. . . . . . . . . . . . . . . . . . . . . . . . 59
5.13 Lea ning cu es h oughou he di e en epochs o he model mixed ained
using using a spa ial d opou a e o 5%. . . . . . . . . . . . . . . . . . . . . 60
5.14 Con usion ma ix o he p esen ed mixed model. . . . . . . . . . . . . . . . 63
5.15 Lea ning cu es h oughou he di e en epochs o he mixed model ained
using he inal con igu a ion. . . . . . . . . . . . . . . . . . . . . . . . . . . 64
5.16 Base a chi ec u e diag am o he hie a chical model. . . . . . . . . . . . . 65
5.17 Lea ning cu es h oughou he di e en epochs o he hie a chical model
ained using he inal con igu a ion. . . . . . . . . . . . . . . . . . . . . . . 66
5.18 Con usion ma ix o he p esen ed hie a chical model. . . . . . . . . . . . . 67
5.19 Dis ibu ions o he ac i i ies in he SHL P e iew da ase . [60] ....... 68
5.20 Lea ning cu es h oughou he di e en epochs o he hie a chical model
ained in he SHL p e iew da ase . . . . . . . . . . . . . . . . . . . . . . . 68
5.21 Con usion ma ix o he hie a chical model ained in he SHL p e iew
da ase ........................................ 69
5.22 Lea ning cu es h oughou he di e en epochs o he hie a chical model
ained in he SHL p e iew da ase and ine uned. . . . . . . . . . . . . . . 69
5.23 Con usion ma ix o he hie a chical model ained in he SHL p e iew
da ase and ine uned. .............................. 70
5.24 Box plo depic ing he F1-sco es o he LSTM baseline om subsec ion 5.1.7,
he MLP baseline om sec ion 5.2, he mixed model om subsec ion 5.4.4
and he hie a chical model om sec ion 5.5. The cen al line in each box
ep esen s he median F1-sco e, he edges o he boxes indica e he in-
e qua ile ange, and he whiske s ex end o he ull ange o he da a,
excludingou lie s. ................................ 72
5.25 Ba cha compa ing he pe o mance o he hie a chical model om sec-
ion 5.5 using only one senso . (M.a g. means Mac o A e age and W.a g.
meansWeigh edA e age)............................ 72
5.26 Con usion ma ix o he hie a chical model om sec ion 5.5 on he es se . 74
iii
Lis o Tables
2.1 The 10 Spanish ci ies wi h he mos a ic jams in 2022. [43] ........ 7
2.2 A e age ba e y consump ion o he conside ed senso s. In o ma ion aken
om many examples ound in he li e a u e and some es s made o di-
e sesma phones................................. 27
3.1 Summa y o Use Da a in he TMD da ase . [13] ............... 37
3.2 Time du a ions o a ious ac i i ies in he TMD da ase . [13] ....... 37
3.3 Dis ibu ion o da a by anspo mode pe use exp essed in hou s o he
Collec y da ase . [19] ............................... 39
5.1 Numbe o unseen use s by anspo in he alida ion se a e applying
he di e en use s spli con igu a ion. . . . . . . . . . . . . . . . . . . . . . 45
5.2 A e age pe o mance o he g oup 5- old wi h each o he wo sepa a ion
algo i hms. (M.a g. means Mac o A e age and W.a g. means Weigh ed
A e age) ...................................... 45
5.3 A e age pe o mance o he g oup 5- old wi h each o he con igu a ions.
(M.a g. means Mac o A e age and W.a g. means Weigh ed A e age) (WS
means Window Size and OF means O e lapping Fac o . . . . . . . . . . . 46
5.4 A e age pe o mance wi h each o he da a augmen a ion e sions. (M.a g.
means Mac o A e age and W.a g. means Weigh ed A e age) . . . . . . . 48
5.5 Classi ica ion Repo s using O iginal con igu a ion (le ) s da a augmen-
a ion base con igu a ion ( igh ). . . . . . . . . . . . . . . . . . . . . . . . . 49
5.6 A e age pe o mance using di e en Gaussian smoo hing pa ame e s. (M.a g.
means Mac o A e age and W.a g. means Weigh ed A e age) (The i s en-
y in he able shows he esul s wi hou smoo hing) . . . . . . . . . . . . 50
5.7 Ou lie Analysis by Use ID and Label . . . . . . . . . . . . . . . . . . . . . 51
5.8 Classi ica ion Repo s showing a e age pe o mance o LSTM model ained
a e ou lie sde ec ion .............................. 52
5.9 Pa ame e se ings o SVM, RF, KNN, and MLP andom sea ches. Bold
alues indica e ha his is he inal alue chosen o each pa ame e . . . . 54
5.10 A e age pe o mance using adi ional machine lea ning a chi ec u es. (M.a g.
means Mac o A e age and W.a g. means Weigh ed A e age) . . . . . . . 54
5.11 A e age pe o mance using di e en sizes o he BiLSTM laye s. (M.a g.
means Mac o A e age and W.a g. means Weigh ed A e age) . . . . . . . 56
5.12 A e age pe o mance wi h each o he egula iza ion me hods in he mixed
model. (M.a g. means Mac o A e age and W.a g. means Weigh ed A e -
age) (Dp e e s o he d opou a e, SDp e e s o he Spa ial d opou a e
and L2 e e s o he L2 egula iza ion pa ame e ) . . . . . . . . . . . . . . . 59
Chap e 1. P elimina y 4
The nex s ep is he expe imen a ion s ep, in which bo h adi ional machine lea ning
models and deep lea ning models, such as con olu ional neu al ne wo ks (CNN), ecu -
en neu al ne wo ks (RNN) and T ans o me s, will be compa ed and adap ed o he ask
o anspo ac i i y ecogni ion. Following his, we will p esen he implemen a ion o
he p oposed sys em a e he s udy ca ied ou .
Finally, he epo will conclude wi h he discussion on he impac ha he implemen a-
ion o his ype o echnology can ha e on oday’s socie y and he u u e wo k p oposed.

5
Chap e 2
Fundamen al knowledge
This chap e se s up he heo e ical g oundwo k on which his hesis elies and o e s
eade s he essen ial heo e ical in o ma ion o comp ehend he ollowing chap e s. The
i s pa o he chap e del es in o he opic o Mobili y in he Ba celona me opoli an
a ea, p o iding a comp ehensi e o e iew o he egion’s anspo a ion dynamics. Sub-
sequen ly, i in oduces he T anspo Mode Recogni ion ask, desc ibing i s signi icance
in he con ex o mobili y analysis. In he pu sui o e ec i e ecogni ion, he chap e ex-
plo es a ious machine lea ning echniques, wi h a special ocus on deep lea ning me h-
ods. Addi ionally, i co e s he c i ical aspec o e alua ion, which ensu es he eliabili y
and accu acy o he de eloped models. Fu he mo e, he chap e explain he di e se
Da a Acquisi ion Modali ies u ilized in collec ing he necessa y da a o his ask.
2.1 U ban mobili y in Ba celona
Du ing a ypical wo kday in 2019, he e we e 5.7 million ips made in Ba celona, a e ag-
ing 3.6 ips pe pe son. A sligh decline o 0.3% in o al ips was obse ed in 2021 (las
o icial da a a ailable) when excluding p o essionals like axi d i e s. This da a was col-
lec ed om he annual Mobili y Su ey on Wo kdays (EMEF), conduc ed collabo a i ely
by a ious local and me opoli an anspo a ion au ho i ies [26].
Public anspo accoun s o app oxima ely 17% o all jou neys made in Ba celona. Va -
ious modes o public anspo se e e e y dis ic o Ba celona, wi h buses, commu e
ail, and ligh ail - encompassing bo h subway and am - being he p ima y op ions
[16]. Figu e 2.1 illus a es he qua e ly passenge coun ends o each o hese ans-
po modes om 2016 o 2021.
As can be seen in he g aph, since 2016 he use o he a ious modes o public anspo
in Ba celona has emained ai ly s able wi h some luc ua ions. Howe e , as expec ed,
du ing 2020 a dec ease in all ypes o anspo has been obse ed due o he Co id-19
season. Du ing 2021 a ebound in da a is obse ed wi hou eaching p e-Co id le els.
The ebounds in 2021 sugges a eco e y phase and possibly a e u n o con idence in
using public anspo a ion. Al hough las yea ’s da a ha e no ye been published, i is
expec ed ha public anspo use has e u ned o he le els o he p e-Co id yea s.
Chap e 2. Fundamen al knowledge 6
FIGURE 2.1: Numbe o use s (millions) o each public anspo pe qua -
e in Ba celona (2016- 2021). [16]
On he opposi e side, in e ms o p i a e anspo , almos hal he ips, speci ically
39%, a e made using pe sonal ca s, in Ba celona [16]. The ecen pandemic has engen-
de ed a disce nible shi in he populace’s anspo a ion p e e ences, p ima ily d i en by
heal h and sa e y conce ns associa ed wi h public ansi sys ems. The a e sion o sha ed
spaces, pa icula ly in he con ex o public anspo a ion, has p omp ed an augmen ed
eliance on pe sonal ehicles.
This eme gen end has in ensi ied a ic conges ion wi hin he ci y. Empi ical da a sug-
ges s a consequen ial 29% augmen a ion in a el du a ions pu ely a ibu able o a ic
conges ion in Ba celona. In ac , Ba celona is now he ci y in Spain wi h he g ea es a ic
p oblems acco ding o da a om TomTom a ic index [58] (see Table 2.1). This subs an ial
inc emen is unpa alleled in he Spanish con ex ; o ins ance, Mad id, ano he signi i-
can u ban conglome a e, wi nesses a compa a i ely lowe 23% inc ease in a el ime
due o ehicula conges ion [43]. This di e gence in u ban mobili y pa e ns be ween he
wo ci ies unde sco es he impe a i e o ailo ed anspo a ion s a egies, pa icula ly
in he pos -pandemic e a.
Chap e 2. Fundamen al knowledge 7
TABLE 2.1: The 10 Spanish ci ies wi h he mos a ic jams in 2022. [43]
Ci y A g. 10 km ime (min) Hou s in a ic pe yea A g. Speed (km/h)
Ba celona 18.3 161 29
Mad id 18 159 29
Valencia 16.3 141 33
Gijón 15.6 127 36
Se illa 14.8 136 34
Vi o ia 14.8 122 38
Málaga 14.6 126 36
Za agoza 14.5 121 36
G anada 14.3 129 36
Palma de Mallo ca 14.1 129 36
2.1.1 Fu u e o Mobili y in Ba celona
The Mobili y Plan in Ba celona [17] showcases a o wa d- hinking app oach owa ds
u ban sus ainabili y and li abili y. By educing p i a e ehicle use and enhancing public
anspo e iciency, he plan add esses bo h en i onmen al conce ns and mode n u ban
li ing s anda ds. The expansion o pedes ian s ee s and bike lanes, along wi h he p o-
mo ion o sha ed ehicle se ices, p omises a mo e ac i e, heal hy li es yle among esi-
den s. Fu he mo e, he "Supe illa" p ojec and Via Laie ana’s ans o ma ion con ibu e
o c ea ing communal and g een spaces, which a e i al o social in e ac ions and men al
well-being. Howe e , esiden s migh ace a ansi ional phase, adap ing o new mobil-
i y pa e ns and po en ially al e ed a ic condi ions. The ambi ious goal o shi ing he
majo i y o commu es o walking, cycling, and public anspo by 2024 means a subs an-
ial change in daily ou ines. Ye , i execu ed e ec i ely, hese al e a ions could lead o
a mo e accessible and en i onmen ally iendly u ban landscape, enhancing he o e all
li ing expe ience in Ba celona.
I should be no ed ha his plan co esponds o Ba celona Ci y Council’s 2023 bid. I may
be subjec o change wi h he new candida u e.
2.1.2 Ou ole in u ban mobili y o Ba celona
As can be seen om he da a shown in he p e ious sec ions, mos o he s udies on mo-
bili y in Ba celona a e based on da a ob ained om ci izen su eys. This is why upda ed
da a o he las ew yea s has no ye been ob ained. This complica es he analysis o
he impac o he ag eed mobili y plan o imp o e mobili y in he ci y since da a collec-
ion by con en ional me hods is slow and complica ed, o en equi ing signi ican human
esou ces and inancial in es men .
Relying solely on ci izen su eys p esen s a se ies o limi a ions. Fi s ly, hese su eys
a e subjec o biases, as people migh no accu a ely ecall o hones ly epo hei ans-
po a ion habi s. Secondly, he pe iodic na u e o hese su eys means ha eal- ime o
equen da a upda es a e i ually non-exis en , making i challenging o moni o apid
changes in mobili y pa e ns o o assess he immedia e impac s o newly implemen ed
policies.
Chap e 2. Fundamen al knowledge 8
T ansi ioning o a anspo mode de ec ion sys em using sma phone mo ion senso s
o e s a compelling al e na i e. Such a sys em ensu es nea eal- ime, objec i e da a col-
lec ion, elimina ing biases inhe en in pe sonal ecall o epo ing. Addi ionally, his
digi al app oach is cos -e ec i e, scalable, and adap able o apidly changing scena ios.
Le e aging his echnology-d i en me hod will g ea ly enhance Ba celona’s abili y o e -
ec i ely analyze and manage u ban mobili y, ensu ing mo e in o med decision-making
in i s pu sui o imp o ed anspo a ion dynamics.
2.2 T anspo mode ecogni ion ask
T anspo mode ecogni ion is a sub- ield o he human ac i i y ecogni ion ask ha
in ol es iden i ying and ca ego izing he mode o anspo a ion used by an indi idual
o an objec . This p ocess has a ious applica ions and, s ill oday, suppose a numbe o
challenges.
2.2.1 Applica ions o anspo mode ecogni ion ask
In he ealm o u ban planning and a ic managemen , anspo a ion mode ecogni-
ion p o ides c ucial da a o op imize ci y in as uc u e and imp o e a ic low. By un-
de s anding how people mo e abou he ci y, au ho i ies can make in o med decisions
abou public ansi expansion, bike lane de elopmen , and oad main enance. A his
poin , he ask o anspo ecogni ion plays a decisi e ole. This is because i allows he
collec ion o da a o he subsequen analysis o u ban mobili y on a la ge scale.
In he ield o heal hca e, his echnology can con ibu e o acking and encou aging
physical ac i i y, helping indi iduals lead heal hie li es. Sma wea ables and heal h
apps can use anspo a ion mode ecogni ion o moni o use s’ ac i i y le els and o e
pe sonalized i ness ecommenda ions.
Mo eo e , anspo a ion mode ecogni ion has a p o ound impac on en i onmen al
sus ainabili y. By p omo ing eco- iendly modes o anspo like cycling o walking
and discou aging he excessi e use o pe sonal ca s, we can collec i ely educe ca bon
emissions and alle ia e he bu den on ou plane .
2.2.2 Challenges o anspo mode ecogni ion ask
As summa ized in 3.1, much esea ch has been ca ied ou in anspo mode ecogni-
ion. Howe e , his ield s ill aces many echnical challenges. Some o he di icul ies a e
sha ed by o he pa e n ecogni ion domains, such as compu e ision and na u al lan-
guage p ocessing, while o he s a e speci ic o senso -based ac i i y de ec ion and need
specialized algo i hms o eal-wo ld applica ions. In he ollowing, we p esen a se
o ca ego ies ou lining he challenges. A isual ep esen a ion o his axonomy can be
ound in Figu e 2.2.
•Da a acquisi ion: T aining and e alua ing deep lea ning models equi e la ge an-
no a ed da a. In his con ex , i is pa icula ly expensi e and ime-consuming o
collec senso y ac i i y da a (see sec ion 2.6).
•Fea u e ex ac ion: This challenge is usually sha ed wi h o he classi ica ion p ob-
lems. Fo senso -based anspo ecogni ion, i is e en a mo e di icul ask because
Chap e 2. Fundamen al knowledge 9
he e is in e -ac i i y simila i y. This means ha di e en anspo s may ha e sim-
ila cha ac e is ics (e.g., walking and unning). The e o e, i is di icul o p oduce
dis inguishable ea u es o ep esen ac i i ies uniquely.
•Da a dis ibu ion: In his ask, he da ase may be unbalanced o h ee easons.
The i s one is class imbalance. This is an impo an challenge because i is di icul
o ind la ge amoun s o da a on less common anspo s, such as e-scoo e . Apa
om ha , some anspo pa e ns a e use -dependen , which means ha di e en
use s may ha e di e se ac i i y s yles. Finally, he posi ion o di e en con igu a-
ion o he senso s may in luence he simula ed da a.
•Compu a ional cos : This ask is in ended o be used on po able de ices such as
a sma phone. This ype o de ice has limi ed compu a ional esou ces. Fo his
eason, ligh weigh and easily op imizable models mus be gene a ed o his ype
o de ice.
•Concu en anspo s: Ideally, when pe o ming classi ica ion asks, i is aken
in o accoun ha each sample belongs o only one possible class. Howe e , in his
case in oday’s public anspo i is common o people o walk o ake o he ypes
o anspo wi h hem. This should be ea ed di e en ly depending on he inal
applica ion o he sys em.
•P i acy: As he ecogni ion sys em could po en ially eco d use s’ li es con inu-
ously, he e a e isks o pe sonal in o ma ion disclosu e, which make he p i acy
issue de e minan o be analyzed be o e deploying he sys em.
•In e p e abili y: Senso y da a canno be ead like images o sen ences. Fu he -
mo e, due o he inhe en laws in senso s, senso y da a in a iably con ains a lo
o noise in o ma ion. The e o e, us wo hy ecogni ion solu ions mus be able o
analyze senso y inpu and know which aspec s o da a help wi h ecogni ion.
FIGURE 2.2: Ca ego ies o deep lea ning in senso based human ac i i y
ecogni ion challenges, also applicable o anspo mode ecogni ion. [14]

Chap e 2. Fundamen al knowledge 10
2.3 T adi ional machine lea ning echniques
In he con ex o anspo mode de ec ion using sma phone mo ion senso s, while deep
lea ning models o e ad anced capabili ies and in ica e pa e n ecogni ion, adi ional
machine lea ning echniques emain essen ial o he ounda ion o p edic i e analy ics.
I is o his eason ha his ype o algo i hm will be used as baseline o u he expe i-
men s. This means ha he esul s o hese algo i hms should be used o ensu e ha he
accu acy o he complex models is no lowe han ha achie ed wi h he simple models.
This sec ion del es in o h ee o he mos pe inen adi ional echniques o ou con ex :
RandomFo es (RF), K-Nea es Neighbo s (KNN), and Suppo Vec o Machines (SVM).
2.3.1 Suppo Vec o Machines (SVM)
SVM [28] is a non-pa ame ic supe ised lea ning algo i hm ha ope a es by inding he
hype plane ha bes di ides he da a in o classes (in classi ica ion asks), ensu ing ha
he ma gin be ween he classes is maximized. Fo da a ha is no linea ly sepa able, SVM
u ilizes he ke nel ick, mapping he da a in o highe dimensions whe e a sepa a ing
hype plane can be ound. Figu e 2.3 shows he decision unc ion o a linea ly sepa able
p oblem, wi h h ee samples on he ma gin bounda ies, called “suppo ec o s”.
The hype pa ame e s used o une his algo i hm a e:
•C ( egula iza ion pa ame e ): Con ols he ade-o be ween maximizing he ma -
gin and minimizing classi ica ion e o s. A smalle alue o C c ea es a wide ma -
gin bu may misclassi y mo e da a poin s.
•Ke nel ype: Speci ies he ke nel unc ion o be used (e.g., linea , polynomial, Ra-
dial basis unc ion).
•Gamma: De e mines he shape o he decision bounda y. A low gamma alue will
p oduce a mo e lexible cu e, while a high alue will c ea e a mo e igid con ined
shape.
•Deg ee: Deg ee o he polynomial ke nel unc ion.
FIGURE 2.3: Example o a linea ly sepa able p oblem sol ed by a SVM.
[49]
Chap e 2. Fundamen al knowledge 11
2.3.2 K-Nea es Neighbo s (KNN)
K-Nea es Neighbo s (KNN) [66] is one o he simples ye su p isingly e ec i e clus e ing-
based supe ised machine lea ning algo i hms. I s undamen al p emise is ha da a
poin s ha a e close in ea u e space ha e simila ou pu alues, o class labels. Fo
classi ica ion asks, KNN simply s o es ins ances o he aining da a and wo ks by de e -
mining he ’k’ aining samples closes in dis ance o a new poin and e u ning he mos
common ou pu alue among hem by majo i y o e [66]. Figu e 2.4 shows a isualiza-
ion o his clus e ing algo i hm.
The main hype pa ame e s used o une his algo i hm a e:
•Numbe o Neighbo s (k): The numbe o neighbo s o conside when making
classi ica ions.
•Dis ance Me ic: The me hod o calcula ing dis ance be ween da a poin s, e.g. Eu-
clidean, Manha an, Minkowski, e c.
•Weigh ing: Decides i all neighbo s ha e equal o e o i close neighbo s ha e a
s onge in luence on he p edic ion.
FIGURE 2.4: Visualiza ion o he KNN algo i hm applied o he I is da ase .
[49]
2.3.3 Random Fo es (RF)
Random Fo es (RF) [12] is an ensemble lea ning me hod ha builds upon he oun-
da ional Decision T ee algo i hm. I c ea es a " o es " o decision ees du ing aining,
each cons uc ed using a andom subse o he aining da a and a andom subse o he
ea u es. When making a p edic ion, each ee in he o es cas s a o e, and he Random
Fo es agg ega es hese o es o de e mine he inal ou pu . This ensemble app oach bo h
di e si ies and s abilizes he Decision T ee model’s p edic ions.
The main hype pa ame e s used o une his algo i hm a e:
Chap e 2. Fundamen al knowledge 12
•Numbe o T ees: Speci ies how many decision ees should be buil in he o es .
•Max Fea u es: The maximum numbe o ea u es o conside when looking o he
bes spli .
•Max Dep h: The maximum dep h o he ee.
•Min Samples Spli : The minimum numbe o samples equi ed o spli an in e nal
node.
•Min Samples Lea : The minimum numbe o samples equi ed o be a a lea node.
•Boo s ap: Whe he boo s ap samples a e used when building ees.
2.4 Deep lea ning echniques
A i s co e, senso based anspo mode ecogni ion in ol es in o ma ion ex ac ion o
senso ’s da a embedded in sma phones. These senso s, such as GPS, accele ome e s,
gy oscopes and magne ome e s, collec as amoun s o da a abou human mo emen s
and su oundings.
By de ini ion, deep lea ning is a subse o machine lea ning, which is basically a neu-
al ne wo k wi h h ee o mo e laye s. These neu al ne wo ks a emp o emula e he
beha iou o he human b ain- hough a om ma ching i s capabili ies, bu allow i o
"lea n" om la ge amoun s o da a. Al hough a neu al ne wo k wi h a single laye can
al eady make app oxima e p edic ions, addi ional hidden laye s help o op imize and
e ine accu acy [31].
One o he ema kable aspec s o deep lea ning in his con ex is i s abili y o de ec pa -
e ns and ea u es wi hin senso da a ha would be nea ly impossible o humans o
de ec wi h o he adi ional me hods. This is why, u ilizing a neu al ne wo k o ex ac
empo al ea u es becomes ad an ageous when building an end- o-end deep lea ning
model [37]. This end- o-end lea ning app oach s eamlines he aining p ocess and im-
p o e mu ual enhancemen be ween ea u e lea ning and ecogni ion p ocesses. Nume -
ous deep lea ning echniques ha e been employed o he ex ac ion o empo al in o -
ma ion, he mos common ones o he ask o his hesis will be explained below.
2.4.1 Mul ilaye pe cep on
The mul ilaye pe cep on, as desc ibed in e e ence [22], o ms he ounda ion o eed-
o wa d ne wo ks. I consis s o a sys em o simple in e connec ed neu ons, o nodes,
as illus a ed in Figu e 2.5, which is a model ep esen ing a nonlinea mapping be ween
an inpu ec o and an ou pu ec o . The nodes a e connec ed by weigh s and ou pu
signals which a e a unc ion o he sum o he inpu s o he node modi ied by a simple
nonlinea ans e , o ac i a ion, unc ion. I is he supe posi ion o many simple nonlin-
ea ans e unc ions ha enables he mul ilaye pe cep on o app oxima e ex emely
non-linea unc ions.
Chap e 2. Fundamen al knowledge 13
FIGURE 2.5: Rep esen a ion o a mul ilaye pe cep on wi h wo hidden
laye s. [22]
The mul ilaye pe cep on ope a es h ough a s uc u ed sequence o laye s, each wi h a
speci ic ole in in o ma ion p ocessing:
•Inpu Laye : This is he ini ial laye o he ne wo k, composed o a i icial inpu
neu ons. These neu ons hold he o iginal da a ep esen ing ex e nal inpu s o ea-
u es.
•Hidden Laye s: Posi ioned be ween he inpu and ou pu laye s, he hidden laye s
play a pi o al ole. They apply ans o ma ions o he inpu da a using ac i a ion
unc ions and hen pass hese ans o med alues o he ou pu laye . Wi hin hese
hidden laye s, he neu al ne wo k de ines i s weigh s, which signi y he s eng h
o connec ions be ween indi idual nodes. Weigh upda es, a c i ical componen ,
ep esen he lea ning phase du ing neu al ne wo k aining. Adjus ing weigh s
helps he ne wo k ine- une i s abili y o ecognize pa e ns and make accu a e p e-
dic ions.
•Ou pu Laye : This inal laye o he ne wo k p o ides he algo i hm’s ou pu ,
ansmi ing he esul s o he compu a ions pe o med by he p eceding laye s.
Finally, he lea ning o he neu al ne wo k is due o he backp opaga ion algo i hm [62].
This algo i hm in ol es wo main s eps: he o wa d pass, whe e inpu da a is p ocessed
h ough he ne wo k o p oduce an ou pu , and he backwa d pass, whe e he e o be-
ween he p edic ed ou pu and he ac ual a ge is p opaga ed backwa d h ough he
laye s. Du ing he backwa d pass, weigh s a e upda ed o minimize his e o by mo -
ing in he di ec ion ha educes i , wi h he lea ning a e con olling he s ep size. This
p ocess is epea ed o mul iple i e a ions, g adually imp o ing he ne wo k’s abili y o
make accu a e p edic ions on aining da a.
Chap e 2. Fundamen al knowledge 20
alue is compu ed by a compa ibili y unc ion o he que y wi h he co esponding key
[59]. The mos commonly used a en ion unc ion is Scaled Do -P oduc A en ion (see
Figu e 2.14). In his a ian , he a en ion unc ion is compu ed on a se o que ies simul-
aneously, packed oge he in o a ma ix Q. The keys and alues a e also packed oge he
in o ma ices K and V. The ma ix ou pu is as ollows:
A en ion(Q,K,V) = so max(QKT
√dk
)V(2.1)
FIGURE 2.14: Scaled Do -P oduc A en ion mechanism [59].
The Scaled Do -P oduc A en ion mechanism, while e ec i e, has i s limi a ions when
dealing wi h complex da a s uc u es. To add ess his, he concep o Mul ihead A en-
ion was in oduced [59]. The p ima y idea behind Mul ihead A en ion is o allow he
model o ocus on di e en pa s o he inpu simul aneously, cap u ing a ious ypes o
ela ionships and dependencies. Ins ead o using a single se o a en ion weigh s, he
mul ihead a en ion block employs mul iple se s, o en e e ed o as "heads". Each head
compu es i s own a en ion weigh s and p oduces i s own ou pu ec o . These ou pu s
a e hen conca ena ed and linea ly ans o med o p oduce he inal ou pu o he mul i-
head a en ion block. This p ocess is ep esen ed by he ollowing equa ion:
Mul iHead(Q,K,V) = Conca (head1, . . . , headn)WO(2.2)
Figu e 2.15 ep esen s he mul ihead a en ion block, aking has he numbe o heads
employed. As can be obse ed in he igu e, a e compu ing he a en ion sco es and
ob aining he weigh ed sum o he Value ec o s, he esul s ( o mul iple heads in mul i-
head a en ion) a e conca ena ed. Finally, he ou pu is ypically passed h ough ano he
linea laye o p oduce he inal ou pu .

Chap e 2. Fundamen al knowledge 21
FIGURE 2.15: Mul ihead a en ion block [59].
2.4.8 T ans o me s
T ans o me s [59], employ an a en ion mechanism ha sys ema ically assesses an inpu
sequence’s elemen s, assigning a ying deg ees o impo ance o each elemen a e e y
s ep. This no el app oach has e olu ionized sequen ial da a analysis, p og essi ely su -
passing LSTM, which was he p e ious s a e-o - he-a model in his domain.
To achie e his, he T ans o me s ollow a e y cha ac e is ic a chi ec u e, shown in Fig-
u e 2.16. The le pa o he a chi ec u e co esponds o he Encode block. The encode
is composed o a s ack o N_x iden ical laye s. E e y laye consis s o wo sub-laye s.
The ini ial one is a mul i-head sel -a en ion mechanism, while he subsequen one is a
s aigh o wa d, posi ion-wise ully connec ed eed- o wa d ne wo k. A esidual con-
nec ion a ound bo h sub-laye s, complemen ed by laye no maliza ion, is applied.
On he o he hand, he igh pa o he a chi ec u e co esponds o he Decode block.
The decode is also composed o N_x iden ical laye s. Besides he wo sub-laye s in e e y
encode laye , he decode inco po a es a hi d sub-laye ha execu es mul i-head a en-
ion on he encode s ack’s ou pu . Changes we e made o he sel -a en ion sec ion in he
decode o p e en i om looking ahead. By shi ing he ou pu by one posi ion, i ’s en-
su ed ha p edic ions a any gi en posi ion a e based solely on ou pu s om p eceding
posi ions.
Finally, wo impo an componen s o he ans o me a chi ec u e a e embeddings and
posi ional encodings. Embeddings a e a way o con e disc e e a iables, like wo ds
o okens, in o con inuous ec o ep esen a ions. Posi ional Encoding is added o he
embeddings be o e he da a is ed in o he encode o decode . This ensu es ha he
ans o me has bo h he seman ic in o ma ion om he embeddings and he posi ional
in o ma ion om he posi ional encoding. This sol es an inhe en limi a ion o he s an-
da d ans o me model, since o iginally i did no ake in o accoun he o de o he
inpu . This is because i does no inhe en ly p ocess he da a in sequence, like ecu en
neu al ne wo ks (RNNs).
Chap e 2. Fundamen al knowledge 22
FIGURE 2.16: The T ans o me - model a chi ec u e. [59]
2.4.9 T ans o me s in T anspo mode ecogni ion
T ans o me s, wi h hei p o iciency in handling sequen ial da a, can be pi o al in ans-
po mode de ec ion using sma phone mo ion senso s. Thei sel -a en ion mechanism
allows hem o disce n speci ic mo ion pa e ns ha can cha ac e ize di e en anspo
modes, like dis inguishing he hy hmic mo emen o walking om he smoo he mo ion
o ehicula a el. Mo eo e , he abili y o ans o me s o in eg a e da a om mul iple
senso s, such as accele ome e s and gy oscopes, u he imp o es hei e icacy in his
applica ion.
Howe e , hese ad an ages come wi h ce ain ade-o s. Fo one, he compu a ional
demands o T ans o me models a e high, po en ially posing challenges o eal- ime
p ocessing on esou ce-cons ained sma phones. This complexi y also ansla es o in-
c eased powe consump ion, which is a conce n o ba e y-dependen de ices. Addi-
ionally, while hey excel in ich da a en i onmen s, ans o me s can be p one o o e i -
ing when ained on limi ed da ase s. This means ha despi e hei imp essi e pe o -
mance du ing aining, hey migh no gene alize well o eal-wo ld, unseen da a. Las ly,
hese models equi e subs an ial labeled da a o e ec i e aining, and acqui ing such
da a o e e y possible anspo mode in a ying condi ions can be a huge challenge.
2.5 Pe o mance e alua ion
The e ec i eness o a classi ie is hea ily in luenced by he a ibu es o he da a i needs
o classi y. To e alua e i s pe o mance in a ious con ex s, a combina ion o me ics and
Chap e 2. Fundamen al knowledge 23
isual me hods a e employed. He e is a de ailed explana ion o he e alua ion me ics
used in his wo k.
2.5.1 Pe o mance Me ics
Pe o mance me ics a e an in eg al componen o e e y machine lea ning pipeline, se -
ing as i al indica o s o p og ess and success. These me ics p o ide quan i a i e mea-
su es ha help in assessing he e ec i eness o a model, o e ing clea , nume ical insigh s
in o i s pe o mance. To his end, we del e in o ou key me ics: p ecision, ecall, F1-
sco e, and accu acy. Each o hese me ics p o ides unique insigh s in o he pe o mance
o he classi ie .
•P ecision: This me ic indica es he p opo ion o co ec ly p edic ed posi i e ob-
se a ions o he o al p edic ed posi i es.
P ecision =T ue Posi i es (TP)
T ue Posi i es (TP) +False Posi i es (FP) (2.3)
•Recall: Recall calcula es he p opo ion o ac ual posi i es ha we e co ec ly iden-
i ied.
Recall =T ue Posi i es (TP)
T ue Posi i es (TP) +False Nega i es (FN) (2.4)
•F1-Sco e: The F1-Sco e is he weigh ed a e age o p ecision and ecall.
F1-Sco e =2×P ecision ×Recall
P ecision +Recall (2.5)
•Accu acy: I measu es he p opo ion o ue esul s (bo h ue posi i es and ue
nega i es) among he o al numbe o cases examined.
Fu he mo e, while hese me ics a e in ui i e, hey may no always be he bes me ic
o imbalanced classes, which is common in anspo mode de ec ion. Two a ian s o
he abo e me ics a e used in his case o a mo e in o ma i e pe o mance analysis:
•Mac o A e age: This a e ages he me ic independen ly o each class and hen
akes he a e age (hence ea ing all classes equally).
•Weigh ed A e age: This accoun s o class imbalance by weigh ing he a e age o
he me ic in a ou o he mos abundan class. I is calcula ed o each class label,
and he a e age is weigh ed by he numbe o ue ins ances o each label.
2.5.2 Con usion Ma ix
Acon usion ma ix is a i al ool in he e alua ion o classi ie s. I o e s a isual ep e-
sen a ion o a classi ie ’s pe o mance. In his ma ix, each ow ep esen s he ins ances
in an ac ual class, and each column co esponds o he ins ances in a p edic ed class (see
Figu e 2.17). The ma ix aids in unde s anding he ypes o e o s made by he classi ie ,
o example, mis aking walking o cycling o d i ing o public ansi .
Chap e 2. Fundamen al knowledge 24
FIGURE 2.17: Con usion ma ix’s simple example [23].
2.5.3 Lea ning Cu es
T aining cu es a e g aphical ep esen a ions ha show he e olu ion o he model’s
pe o mance o e ime du ing he aining p ocess. These cu es ypically include loss
cu e and accu acy cu e. Moni o ing hese cu es helps in de ec ing issues such as
o e i ing o unde i ing, bias and a iance allowing o necessa y adjus men s o he
model’s aining p ocess (see Figu e 2.18).
FIGURE 2.18: Bias and a iance ep esen ed in an e o ’s lea ning cu e
[23].
2.5.4 G oup k- old c oss- alida ion
G oup k-Fold C oss-Valida ion was u ilized as he p ima y model e alua ion echnique
in his s udy, ailo ed o da ase s wi h dis inc g oupings. This me hod is especially
app op ia e o da a seg ega ed by en i ies such as use s, which is he case, ensu ing no
o e lap be ween aining and es ing se s. The da ase is di ided in o ’k’ dis inc g oups
wi h di e en use s on each g oup, wi h each one successi ely used as a es se while
he o he s o m he aining se . This s a egy gua an ees comp ehensi e u iliza ion o
da a o bo h aining and alida ion pu poses and ensu es ha each g oup is en i ely
Chap e 2. Fundamen al knowledge 25
excluded om he aining da a du ing i s u n as he alida ion se , hus bols e ing he
e alua ion’s obus ness and ele ance.
Following he G oup k-Fold C oss-Valida ion, an Mann-Whi ney U es [45] was con-
duc ed o s a is ically compa e models. This s a is ical es , also known as he Wilcoxon
ank-sum es , is a non-pa ame ic s a is ical es used o compa e wo independen sam-
ples o de e mine whe he he e is a di e ence in hei dis ibu ion. I is pa icula ly use-
ul o compa ing models in cases whe e he da a does no ollow a no mal dis ibu ion,
which is a common assump ion o many pa ame ic es s. By applying Mann-Whi ney
U es o he esul s ob ained om each old o he c oss- alida ion, he s udy could de-
e mine i he e is a signi ican di e ence in he pe o mance o he wo models.
2.6 Da a acquisi ion modali ies
In his sec ion, we will explo e a ious me hods and echnologies o ga he ing da a e-
la ed o human ac i i y and mo emen . The sec ion will del e in o h ee p ima y modal-
i ies: mo ion, loca ion, and ambien sensing. Fo each modali y, he ad an ages and
disad an ages will be examined, o e ing an objec i e o e iew o hei s eng hs and
limi a ions in da a acquisi ion o di e se pu poses.
2.6.1 Mo ion modali y o anspo mode ecogni ion
The pe o mance o an ac i i y ecogni ion sys em depends c ucially on he senso modal-
i y used. The e a e di e se ypes o senso s, such as wea able senso s, ambien senso s,
and loca ion senso s. Howe e , in his wo k, we a e going o ocus on he mos com-
monly used senso s a ailable in sma phones, wea able senso s [20].
•Accele ome e s a e de ices used o measu e accele a ion, speci ically he a e o
change in an objec ’s eloci y. They a e ypically measu ed in me es pe second
squa ed (m/s2) o G- o ces and ope a e a sampling equencies anging om ens
o hund eds o Hz. They p o ide a i- a ia e ime se ies due o hei h ee axes (see
Figu e 2.19).
•Gy oscopes measu e o ien a ion and angula eloci y, wi h he uni o angula e-
loci y being adian s pe second ( ad/s). Like accele ome e s, hey also ope a e a
sampling a es anging om ens o hund eds o Hz. Gy oscopes a e o en in e-
g a ed wi h accele ome e s, and also p o ide h ee axes o da a (see Figu e 2.20).
•Magne ome e s, on he o he hand, a e commonly used wea able senso s and a e
usually combined wi h accele ome e s and gy oscopes in o an ine ial uni . They
measu e changes in he magne ic ield a a speci ic loca ion, using Tesla (T) as he
measu emen uni and ha ing sampling a es in he ens o hund eds o Hz. Mag-
ne ome e s, like he o he s, also ha e h ee axes. They can be used o es ima e he
h ee-dimensional o ien a ion o he de ice ela i e o he Ea h’s magne ic no h.
Figu e 2.21 depic s he unc ioning o a magne ome e .

Chap e 2. Fundamen al knowledge 26
Ad an ages o mo ion modali y o anspo mode ecogni ion
Using a combina ion o accele ome e , gy oscope, and magne ome e senso s is ad an-
ageous o ac i i y ecogni ion because i p o ides a comp ehensi e and obus da ase .
This combina ion o e s he ollowing bene i s:
•Comp ehensi e Da a: A wide a ie y o in o ma ion is p o ided by hese h ee
senso s when aken oge he , including linea accele a ion ( om he accele ome e ),
angula eloci y ( om he gy oscope), and o ien a ion wi h ega d o he Ea h’s
magne ic ield ( om he magne ome e ). This ex ensi e da ase eco ds many ace s
o mo ion and o ien a ion, enabling a mo e comple e comp ehension o he use ’s
mo ions.
•O ien a ion Awa eness: The magne ome e o e s impo an de ails ega ding he
use ’s o ien a ion wi h espec o he Ea h’s magne ic ield. This in o ma ion is
pa icula ly use ul o classi ying modes like walking and bicycling, whe e changes
in di ec ion play a big ole.
•Real-Time Capabili y: The da a om hese senso s can be p ocessed in eal- ime,
allowing o ins an aneous mode ecogni ion.
•P i acy Conside a ions: Unlike GPS, which can be highly in usi e in e ms o
use p i acy, accele ome e , gy oscope, and magne ome e da a can be p ocessed
wi hou e ealing he use ’s exac loca ion.
•Widesp ead a ailabili y: All mode n sma phones come equipped wi h hese sen-
so s as s anda d ha dwa e componen s. This a ailabili y makes i excep ionally
con enien and cos -e ec i e o implemen anspo mode ecogni ion on a la ge
scale, as use s do no need o in es in addi ional ha dwa e o de ices.
•Ba e y consump ion: The ba e y consump ion o he sma phone senso s is much
lowe han ha caused by o he sou ces o in o ma ion. This can be seen in de ail
in Table 2.2.
D awbacks o mo ion modali y o anspo mode ecogni ion
On he o he hand, his me hod o da a collec ion also has some d awbacks, which a e
explained below:
•Da a Noise: Senso da a can be noisy, especially in eal-wo ld scena ios. Vib a ions,
shocks, and ex e nal in e e ence can in oduce e o s in o he da a. This noise can
a ec he accu acy o anspo mode ecogni ion algo i hms, leading o inco ec
esul s.
•Dependency on De ice Placemen : The placemen o senso s wi hin a de ice can
a ec hei pe o mance. Di e en sma phones and wea ables may ha e senso s
loca ed in sligh ly di e en posi ions, leading o a ia ions in da a collec ion and
ecogni ion accu acy.
•In eg a ion Challenges: In eg a ing senso -based ecogni ion in o apps o de ices
can be echnically challenging and may equi e specialized knowledge in signal
p ocessing, machine lea ning, and so wa e de elopmen .
Chap e 2. Fundamen al knowledge 27
•Calib a ion and Senso D i : O e ime, senso alues can d i due o empe a-
u e changes o wea and ea . Main aining accu a e and calib a ed senso s can be
a challenge.
FIGURE 2.19: Axis
di ec ions o he ac-
cele ome e o he
sma phones. [9]
FIGURE 2.20: Axis
di ec ions o he gy-
oscope o he sma -
phones. [9]
FIGURE 2.21: Func ioning o he sma phone magne ome e . [9]
TABLE 2.2: A e age ba e y consump ion o he conside ed senso s. In o -
ma ion aken om many examples ound in he li e a u e and some es s
made o di e se sma phones.
GPS (upda e 15sec) WiFi (upda e 15sec) ACC MAG GYR
250 mA 125 mA 0.23 mA 6.8 mA 6.1 mA
Chap e 2. Fundamen al knowledge 28
2.6.2 Loca ion modali y o anspo mode ecogni ion
Loca ion-based in o ma ion can also be used o iden i y a use ’s mode o anspo a ion
o ac i i y. This me hod uses in o ma ion om he Global Posi ioning Sys em (GPS) o
o he loca ion se ices o ob ain a pe son’s cu en posi ion and a e o mo emen . The
ollowing a e some bene i s and d awbacks o u ilizing loca ion modali y o iden i ying
anspo modes:
Ad an ages o loca ion modali y o anspo mode ecogni ion
•High-Le el In o ma ion: Loca ion da a can p o ide high-le el in o ma ion abou
a use ’s ac i i y, such as whe he hey a e indoo s, ou doo s, in a ca , on oo , o
using public anspo a ion. This can be aluable o ecognizing anspo modes.
•Easy In eg a ion: GPS lib a ies a e usually in eg a ed in o sma phone amewo ks.
This makes i easie o wo k wi h his ype o da a.
•Con ex ual in o ma ion: loca ion da a p o ides con ex ual in o ma ion abou he
ip.
D awbacks o loca ion modali y o anspo mode ecogni ion
•Indoo Limi a ions: Loca ion da a can be less accu a e indoo s o in a eas wi h
poo GPS signal ecep ion. Recognizing anspo modes o ac i i ies indoo s can
be challenging.
•Lack o Fine-G ained In o ma ion: Loca ion da a may no p o ide ine-g ained in-
o ma ion abou speci ic anspo modes, such as dis inguishing be ween di e en
ypes o ehicles (e.g., ca , bus, ain).
•Ba e y Consump ion: Con inuous GPS usage can consume a signi ican amoun
o powe , po en ially a ec ing de ice ba e y li e.
•P i acy Conce ns: Ga he ing loca ion da a aises p i acy conce ns, as i can e eal
a use ’s whe eabou s. App de elope s mus handle loca ion da a esponsibly and
anspa en ly o add ess use p i acy conce ns.
•Dependency on Loca ion Se ices: T anspo mode ecogni ion based on loca ion
da a elies on he a ailabili y and accu acy o loca ion se ices on he use ’s de ice.
Any issues wi h hese se ices can a ec he eliabili y o he ecogni ion sys em.
2.6.3 Ambien modali y o anspo mode ecogni ion
Ambien senso s, such as Wi-Fi, RFID (Radio-F equency Iden i ica ion), and ada , can
be used o anspo mode ecogni ion as well.
•Wi-Fi is a local-a ea wi eless ne wo k connec ion echnology ha uses a ansmi e
o send signals o a ecei e . The basis o WiFi-based human ac i i y ecogni ion is
ha human’s mo emen s and loca ions in e e e wi h he signals’ p opaga ion pa h
om he ansmi e o he ecei e , including bo h he di ec p opaga ion pa h and
he e lec ing p opaga ion pa h.
Chap e 2. Fundamen al knowledge 29
•RFID uses elec omagne ic ields o au oma ically iden i y and ack he ags a -
ached o objec s, which con ain elec onically s o ed in o ma ion. RSS is he mos
widely adop ed ool o RFID-based ac i i y ecogni ion; an example is shown in
Figu e 2.22. The wo king mechanism is ha human’s mo emen s would change
he single s eng h ecei ed by he RFID eade [61].
•Rada s. Unlike WiFi and RFID whose ansmi e s and ecei e s a e placed on
opposi e sides, ada ansmi e s and an ennas a e moun ed on he same side o
use s. The Dopple e ec is he basis o he ada -based sys em [39].
Ad an ages o ambien modali y o anspo mode ecogni ion
•Mul i-occupan de ec ion: Each pe son’s p esence and mo emen s can in luence
he Wi-Fi signals di e en ly, making i possible o ecognize and dis inguish mul i-
ple occupan s in he moni o ed a ea. This capabili y is use ul o applica ions like
occupancy sensing in sma homes o acking he numbe o people in a public
space.
•Indoo localizing: Wi-Fi can wo k well indoo s, whe e GPS signals may be weak
o una ailable.
•Ne wo k-based da a: Wi-Fi can p o ide in o ma ion abou he a ailabili y o Wi-Fi
ne wo ks, which can be used as a con ex clue o anspo mode ecogni ion.
D awbacks o ambien modali y o anspo mode ecogni ion
•In as uc u e deploymen : Deploying an RFID o Rada in as uc u e can be
cos ly and ime-consuming, making i less p ac ical o wide-scale use.
•Ba e y consump ion: Depending on he ada sys em’s design, i may consume a
signi ican amoun o powe , which can be a d awback o ba e y-powe ed de ices.
In addi ion, ha ing he phone’s Wi-Fi ac i a ed also consumes a signi ican amoun
o ene gy.
•Limi ed Ou doo Accu acy: Ambien based ecogni ion may be less accu a e o
ou doo ac i i ies, whe e GPS is mo e eliable.
Chap e 3. Backg ound 36
FIGURE 3.3: Posi ioning o he de ice in he da a collec ion p ocess. [60]
As wi h any da ase , he SHL p esen s a unique se o ad an ages and disad an ages ha
esea che s and analys s should conside . Below is an examina ion o i s s eng hs and
po en ial limi a ions.
Ad an ages o he SHL da ase
•Senso a iabili y: Wi h da a poin s anging om basic mo ion senso s like ac-
cele ome e , gy oscope, and magne ome e o ambien ligh and audio, he da ase
p o ides a mul i-dimensional iew o he su oundings and ac ions.
•In eg a ed Thi d-Pa y Da a: The in eg a ion o Google’s ac i i y ecogni ion API
ou pu gi es a benchma k o compa e wi h any cus om ac i i y ecogni ion models.
•Ba e y and Connec i i y Da a: In o ma ion abou ba e y le el and empe a u e,
WiFi and mobile ne wo k de ails p o ide insigh s in o de ice s a us, which can be
c ucial o eal-wo ld, con inuous moni o ing applica ions.
•Posi ioning in o ma ion: The da ase gi es in o ma ion abou he exac posi ioning
o he de ice a each momen o he da a collec ion. This can help o de ec i he
gene a ed models ail a any pa icula posi ion.
Limi a ions o he SHL da ase
•O e whelming Complexi y: The shee b ead h and g anula i y o da a migh be
o e kill o simple applica ions. Handling such as da a equi es mo e p ocessing
powe and ad anced algo i hms.
•Po en ial Redundancies: Some da a ypes migh o e lap in he in o ma ion hey
p o ide. Fo ins ance, accele ome e da a combined wi h gy oscope and o ien a-
ion migh lead o edundan in o ma ion in some scena ios.
•Ha dwa e Dependency: he da ase only comes om a speci ic de ice, which can
make he accu acy o he de eloped models e y dependen on he de ice in use.
•Limi ed Di e si y in Pa icipan s: The da ase comes om only 3 membe s, which
signi ican ly limi s he di e si y o he da a. This migh no ep esen a b oade
popula ion, a ec ing he gene alizabili y o any models ained on his da ase .

Chap e 3. Backg ound 37
3.2.2 T anspo Mode De ec ion Da ase (TMD)
The TMD da ase [13] was assembled by esea che s a he Uni e si y o Bologna who
ga he ed senso da a om hi een olun ee subjec s, comp ising en males and h ee
emales (see Table 3.1). The p ima y aim o his da ase is o classi y a ange o ac i i ies,
which include walking, d i ing a ca , s anding s ill, being on a ain, and iding a bus.
Al oge he , he da ase consis s o 226 labeled iles. These iles ep esen o e 31 hou s
o da a wi h b eakdowns as ollows: 26% o he da a is designa ed as walking, 25% as
d i ing a ca , 24% as s anding s ill, 20% as being on a ain, and 5% as being on a bus (see
Table 3.2).
TABLE 3.1: Summa y o Use Da a in he TMD da ase . [13]
ID Sex Age Occupa ion De ice And oid Ve sion
U1 M 30 s uden LG G2 5.0.2
U2 F 27 s uden Sony XPERIA Z3 Compac D5803 6.0.1
U3 M 30 s uden Nexus 5 7.0
U4 M 36 o ice wo ke Huawei Hono 5X 6.0.1
U5 M 36 s age di ec o Huawei P8 Li e 6.0.1
U6 M 27 esea che Samsung galaxy s3 neo 4.4.2
U7 M 32 came amen Samsung S7 6.0.1
U8 F 32 ba ende Huawei Tag-l01 5.1
U9 F 24 s uden Mo o ola Mo o G 5.1
U10 M 22 s uden Huawei P9 7.0
U11 F 31 o ice wo ke Nexus 5 7.0
U12 M 31 esea che Samsung Galaxy S6 6.0.1
U13 M 60 e i ed Nexus 5 7.0
TABLE 3.2: Time du a ions o a ious ac i i ies in he TMD da ase . [13]
Bus Ca S ill T ain Walking To al
01:44:35 07:53:50 07:29:35 06:20:25 08:20:25 31:48:50
In he ini ial da a p ep ocessing phase, he esea che s unde ook a se ies o da a clean-
ing ope a ions. These included he emo al o measu emen s om non-pe inen senso s
and ensu ing he posi i i y o alues om he sound and speed senso s, among o he ad-
jus men s. I is no ewo hy ha some senso s, especially he ambien ones like sound,
ligh , and p essu e, as well as he p oximi y senso s, p oduced a single da a alue. This
da a was di ec ly inco po a ed in o he da ase . On he o he hand, o he senso s yielded
mul iple alues because hey we e associa ed wi h a coo dina e sys em, implying ha
hei ou pu s we e hea ily in luenced by o ien a ion. Fo mos o hese, he eam adop ed
an o ien a ion-independen me ic, e med magni ude. Following he da a cleaning p o-
cess, he da ase was segmen ed in o ime windows, each o ei he 5 seconds o hal a
second’s du a ion. Subsequen o his di ision, ou dis inc ea u es (min, max, de .s d,
and mean) we e ex ac ed om e e y senso . Figu e 3.4 se es as a summa y o he p e-
p ocessing s eps.
Chap e 3. Backg ound 38
FIGURE 3.4: P ep ocessing s eps on he TMD da ase . [13]
Ad an ages o he TMD da ase
•Di e se Da a Collec ion: The da ase includes senso da a om hi een olun ee
subjec s, enhancing i s ep esen a i eness. This di e si y accoun s o en males
and h ee emales, p o iding a balanced gende dis ibu ion.
•Tho ough P ep ocessing: An ini ial da a cleaning phase ensu es he emo al o
unnecessa y measu es, he co ec ion o senso alues, and he adap a ion o ce ain
senso ou pu s. This esul s in a polished and easily usable da ase .
•Accu a e Use In o ma ion: he da ase explana o y pape p o ides p ecise in o -
ma ion on he use s and he de ices used o collec he da a. This can help o see i
he models p oduced a e able o gene alize o di e en sma phone models.
Limi a ions o he TMD da ase
•Fixed Time Window: The da a is segmen ed in o speci ic ime windows (ei he 5
seconds o hal a second). This ixed windowing migh no cap u e all nuances o
ce ain ac i i ies o migh o e simpli y o he s.
•Res ic ed Numbe o Fea u es: The da ase con ines i s scope o only ou ea-
u es ex ac ed om each senso . This limi a ion migh omi po en ially aluable
in o ma ion o insigh s ha o he ea u es could p o ide.
•Cons ained Da a Collec ion Du a ion: While o e 31 hou s o da a seems ex en-
si e, in he con ex o cap u ing di e se human ac i i ies and beha io s, his du-
a ion migh be conside ed limi ed. I migh no encompass he ull spec um o
a iabili ies and pa e ns inhe en o each ac i i y.
•Limi ed numbe o classes: I would ha e been in e es ing i he da ase had
included o he anspo a ion such as: un, scoo e , bike, subway, e c.
Chap e 3. Backg ound 39
3.2.3 Collec y Da ase
The Collec y da ase [19] o e s a unique pe spec i e in o he anspo a ion habi s wi hin
C oa ia, speci ically in he Ci y o Zag eb. The da a has been accumula ed using he mo-
bile applica ion "Collec y" on And oid de ices. Key senso s, including he accele ome e ,
gy oscope, and magne ome e , ha e been ins umen al in da a collec ion. Ensu ing da a
p i acy, he o ma emains aw and anonymized. The da ase boas s con ibu ions om
15 pa icipan s ac oss a ious age g oups, spanning a da a collec ion pe iod o 5 mon hs.
These pa icipan s we e asked o ac i a e he mobile applica ion, which hen eco ded
senso da a acco ding o hei mode o anspo a ion. To ensu e accu acy, upon eaching
hei des ina ions, pa icipan s alida ed hei ou es ia he app’s displayed digi al map.
Table 3.3 shows he ips made by each use p esen in he da abase.
TABLE 3.3: Dis ibu ion o da a by anspo mode pe use exp essed in
hou s o he Collec y da ase . [19]
Use ID Walk Run Bike Ca Bus T ain T am E-scoo e To al
17 7.92 0.00 0.00 6.24 0.00 2.84 0.00 0.14 17.13
23 10.76 0.06 0.18 0.54 22.73 0.35 5.05 0.00 39.68
24 0.29 0.00 0.00 1.78 0.00 0.00 0.00 0.00 2.06
25 0.71 0.00 0.00 9.47 0.00 0.00 0.75 0.00 10.92
29 29.88 0.00 0.00 4.60 0.92 39.32 0.00 0.18 74.9
37 0.00 0.00 0.00 28.13 0.00 0.00 0.00 0.00 28.13
39 1.27 0.00 0.00 1.47 0.82 3.78 0.00 0.00 7.35
40 6.22 0.02 0.00 0.27 5.66 0.00 2.27 0.00 14.43
18 6.59 3.31 9.41 15.8 0.00 0.00 0.00 5.98 41.09
20 0.02 0.00 0.00 0.00 0.00 0.00 0.14 0.00 0.15
26 0.03 0.00 0.00 0.12 0.00 0.00 0.00 0.00 0.14
27 1.87 0.00 0.00 0.83 0.00 0.78 0.00 0.00 3.47
28 0.04 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.04
31 0.16 0.00 0.00 0.29 0.39 0.00 0.00 0.00 0.85
35 0.09 0.00 0.00 2.07 0.00 0.00 0.00 0.00 2.16
To al 65.85 3.39 9.59 71.61 30.52 47.07 8.21 6.3 242.54
This da ase p o ide a a wide ange o anspo s desc ibed in Figu e 3.5. T amway sees
he leas amoun o use, allying jus a bi o e 10 hou s. In con as , Walking and Ca
a e he p edominan me hods o anspo , wi h bo h nea ing 70 hou s. Bus a el is also
a no able mode, accoun ing o app oxima ely 30 hou s. While Bike and E-scoo e ha e
diminished numbe s, wi h Bike hou s sligh ly su passing 10 and E-scoo e jus alling
sho o ha ma k. T ain a el, on he o he hand, is qui e p ominen , egis e ing a li le
mo e han 50 hou s. The leas equen ac i i y is Running, which is nea ly absen on he
ep esen a ion.
Chap e 3. Backg ound 40
FIGURE 3.5: Collec y da ase dis ibu ion. [19]
Ad an ages o he Collec y da ase
•Wide Range o T anspo s: The da ase co e s a ious modes o anspo a ion,
including amways, walking, ca s, buses, bikes, e-scoo e s, ains, and unning.
This o e s a holis ic iew o anspo a ion habi s.
•De ailed Du a ion Da a: The da ase p o ides exac hou s o usage o each use
and mode o anspo , allowing o quan i a i e analysis and compa isons.
•Anonymized Da a: Ensu es p i acy and con iden iali y o pa icipan s while s ill
p o iding aluable insigh s.
Limi a ions o he Collec y da ase
•Geog aphical Limi a ion: The da a pe ains only o anspo a ion ne wo ks wi hin
C oa ia, speci ically he Ci y o Zag eb, which could limi i s gene alizabili y.
•Applica ion No Public: The Collec y mobile applica ion used o da a collec ion
is no publicly a ailable, which could hinde eplica ion o alida ion o he s udy
by o he esea che s.
•No In o ma ion on De ices: The da ase does no p o ide in o ma ion ega ding
he speci ic de ices used o da a collec ion, which could impac he accu acy and
consis ency o he senso da a.
In conclusion, he cu en landscape lacks a comp ehensi e public da ase capable o e -
ec i ely aining machine lea ning models o p edic ing anspo a ion modes in u ban
se ings. An ideal da ase o his pu pose would encompass da a om a b oad spec-
um o u ban esiden s, encompassing a iou anspo a ion me hods. Addi ionally, i
is c ucial o ensu e me iculous con ol o e da a gene a ion p ocesses and o he ele an
pa ame e s. Wi hin he amewo k o he Mobili App [2] and Mobily ics [3] p ojec s, con-
duc ed in pa ne ship wi h he ATM [1], he e is a conce ed e o o c ea e and p o ide
such a obus , public da ase dedica ed o u ban mobili y da a, se ing bo h esea ch and
u ban planning objec i es.
41
Chap e 4
Ou u ban mobili y da ase
This chap e is dedica ed o desc ibing he me hodology behind he c ea ion and e ine-
men o he da ase ha is cen al o his s udy. I s a s wi h he dea iled exposi ion
o he senso s employed. Then he da a collec ion p ocess is de ailed. Subsequen ly,
he p ep ocessing echniques a e desc ibed. Fu he mo e, some da a augmen a ion ech-
niques a e explained, wi h he in en ion o being applied o imp o e he da ase . Then
Fea u e Ex ac ion ollows, de ailing he ans o ma ion o p ep ocessed da a in o a s uc-
u ed ea u e se , including he Ou lie De ec ion p ocess. Finally, he chap e culmina es
wi h Resul an Da ase sec ion, whe e he cha ac e is ics o he inal da ase — eady o
explo a o y and con i ma o y da a analysis— a e ho oughly desc ibed, se ing he s age
o he esea ch co e ed by his p ojec .
The subsequen con en o his chap e is go e ned by a con iden iali y ag eemen .

42
Chap e 5
Model expe imen a ion and
e inemen
The Expe imen a ion chap e se es as a de ailed in es iga i e wo k wi h he aim o ex-
plo ing and analyze he pe o mance o a ious compu a ional models in he ield. I
begins wi h he de ini ion o he amewo k, documen ing he expe imen a ion wi h di -
e en amewo k con igu a ions, including a ia ions in p epocessing. Once he basis
o he expe imen s has been es ablished, he nex s ep in his chap e is o e alua e he
pe o mance o con en ional machine lea ning algo i hms, which is used as a baseline
o u he expe imen s. Then, di e en deep lea ning a chi ec u es a e explo ed in con-
junc ion wi h he a emp ed ine uning o a p e ained mdoel, ying o push he bound-
a ies o classi ying pe o mance. Finally, he Resul s Discussion sec ion syn hesizes he
expe imen al indings, p o iding a comp ehensi e o e iew o he ou comes and main
conclusions o he expe imen a ion.
5.1 F amewo k de ini ion
In he con ex o his wo k, he amewo k e e s o he se o me hods, echniques, and
algo i hms used o ca y ou he esea ch expe imen s. The e o e, in his sec ion we will
explain he amewo k aken as a empla e and p esen some expe imen s on a ia ions
o he p ep ocessing s eps o de e mine he bes con igu a ion o he ollowing expe i-
men s.
5.1.1 S a ing poin
This p ojec does no s a om sc a ch; in his case, we will s a om a baseline de el-
oped by esea che s and p e ious s uden s o he SISCOM g oup [6][33]. This sec ion
will desc ibe his basis, which will se e as a ounda ion o u he expe imen s.
The main hings o commen on abou he amewo k used so a a e he con igu a ion
o he sliding window, he o e lapping ac o , he sepa a ion be ween aining and ali-
da ion se s, he a chi ec u e o he model used, and some o he p ep ocessing s eps.
Chap e 5. Model expe imen a ion and e inemen 43
Ini ial p ep ocessing
The p ep ocessing s eps ca ied ou in he p e-p ojec phase we e he same as hose de-
sc ibed in ??. Howe e , i is impo an o emphasize he c i ical ole o speci ic pa ame-
e s in his p ocess, pa icula ly he size o he sliding window and he o e lapping ac o ,
bo h o which signi ican ly in luence he sys em’s pe o mance.
The baseline con igu a ion o hese pa ame e s is de ailed as ollows:
•Window size: The window size is es ablished a 200 imes eps. This dimension
dic a es he olume o da a he model p ocesses a any gi en ime, in luencing he
sys em’s abili y o in e p e and lea n om empo al pa e ns wi hin he da a.
•O e lapping ac o : An o e lapping ac o o 50% has been selec ed. This indica es
ha each da a window sha es hal o i s con en wi h he succeeding window.
Ini ial se s sepa a ion
In any p ojec in ol ing machine lea ning models, i is impe a i e o i s seg ega e he
da ase in o aining, alida ion, and es se s be o e p oceeding o model e alua ion.
This segmen a ion is undamen al o accu a ely e alua e he model’s pe o mance in eal-
wo ld applica ions and o conduc a ho ough analysis o po en ial o e i ing.
Fo he baseline, he da ase was di ided p ima ily h ough andom pa i ioning. This
app oach was execu ed o ensu e ha he dis ibu ion o classes and use s emained con-
sis en ac oss all h ee da ase s - aining, alida ion, and es ing.
Ini ial model a chi ec u e
FIGURE 5.1: LSTM baseline a qui ec-
u e.
The a chi ec u e p e iously used up o he ime o
his p ojec was an LSTM model. The pa icula i-
ies o hese a chi ec u es a e explained in subsec-
ion 2.4.5. In his case, he pa icula a chi ec u e con-
sis s o wo LSTM (Long Sho -Te m Memo y) lay-
e s in e spe sed wi h d opou laye s, ollowed by a
dense laye a he end. The LSTM laye s, a y in
hei complexi y and ou pu dimensions, wi h he
i s laye p ese ing he sequence’s leng h, using 200
uni s, and he second condensing i in o a single ec-
o , using 512 uni s. D opou laye s a e employed o
p e en o e i ing, using a 20% d opou a e, an-
domly deac i a ing a ac ion o he neu ons du ing
aining [54]. The inal dense laye se es as he ou -
pu laye , applying he So max ac i a ion. The di-
ag am in Figu e 5.1 shows he global a chi ec u e o
he model.
This a chi ec u e will be ained using he ollowing
pa ame e s o he baseline expe imen s:
•Adam op imize
Chap e 5. Model expe imen a ion and e inemen 44
•Lea ning a e: 0.001
•Ba ch size: 64
•Num. epochs: 70
•Loss unc ion: Ca ego ical c ossen opy
•Random seed: 42
The e alua ion o each expe imen was ca ied ou by unning he expe imen in a 5-
g oup old and ob aining he a e age pe o mance. The expe imen s we e de eloped
in a PC equipped wi h: a he co e a 13 h Gene a ion In el Co e i9-13900F p ocesso ,
complemen ed by 64 GB o physical memo y, he g aphics p ocessing is managed by an
N idia Ge o ce RTX 3060 Li e wi h 12GB o ideo memo y and a 512 GB solid-s a e d i e.
5.1.2 E ec s o se s sepa a ion algo i hm
In his i s expe imen , he e ec s o wo ypes o da ase sepa a ion algo i hms will be
s udied. The objec i e is o compa e how he pe o mance o he model a ies using
he classical sepa a ion algo i hm, explained in sec ion 5.1.1, and using a sligh ly mo e
complex one.
The s anda d algo i hm alloca es da a in o aining, alida ion, and es se s andomly,
ensu ing he dis ibu ion o classes and use s emains consis en . The newe algo i hm,
howe e , places emphasis on popula ing he alida ion and es se s wi h use s who a e
no p esen in he aining se . This s a egy aims o be e simula e eal-wo ld scena ios
whe e he model encoun e s use s i has no p e iously seen.
FIGURE 5.2: T aining and alida ion use s dis ibu ion a e applying he
andom spli con igu a ion.
Chap e 5. Model expe imen a ion and e inemen 45
FIGURE 5.3: T aining and alida ion use dis ibu ion a e applying he
di e en use s spli con igu a ion.
In he compa a i e analysis be ween Figu e 5.2 and Figu e 5.3, a uni o m dis ibu ion o
use s is obse ed ac oss he aining and alida ion se s in he i s con igu a ion, while
he second con igu a ion exhibi s a dis inc use dis ibu ion in he alida ion se . Fu -
he mo e, Table 5.1 elucida es he numbe o no el use s by anspo a ion mode. Despi e
e o s in da ase pa i ioning o achie e di e si y, a pe ec ly balanced ep esen a ion
ac oss all classes emains challenging due o he a iabili y in use numbe s pe ca ego y.
None heless, his da ase spli ing s a egy mo e closely mi o s eal-wo ld condi ions,
po en ially enhancing he obus ness and gene alizabili y o machine lea ning models.
TABLE 5.1: Numbe o unseen
use s by anspo in he alida-
ion se a e applying he di e -
en use s spli con igu a ion.
T anspo Unseen use s
Bike 4
Bus 3
Ca 3
Subway 2
Mo o bike 1
Run 1
S a iona y 7
T ain 3
T am 1
Walk 10
e-Scoo e 2
Fo a comp ehensi e compa ison, he con igu a ions and
model pa ame e s ou lined in p e ious sec ions a e con-
sis en ly applied o bo h algo i hms. Consequen ly, Ta-
ble 5.2 p esen s he a e age pe o mance me ics de i ed
om a 5- old c oss- alida ion o each con igu a ion. Ini-
ially, he andom sepa a ion app oach may appea supe-
io due o i s signi ican ly highe pe o mance me ics.
Howe e , his enhanced pe o mance is a ibu ed o he
model’s o e i ing o da a om he same use s. In con-
as , when he model ained wi h his app oach is e al-
ua ed on unseen da a, he e is a no able dec ease in i s
1-sco e, which d ops o 74%. The e o e, o his s udy,
he mo e sui able algo i hm is iden i ied as he one used
in he second con igu a ion, known as he di e en use s
sepa a ion algo i hm, due o i s simila i y o he eal en-
i onmen .
TABLE 5.2: A e age pe o mance o he g oup 5- old wi h each o he wo
sepa a ion algo i hms. (M.a g. means Mac o A e age and W.a g. means
Weigh ed A e age)
Spli con . F1-sco e M.a g. P M.a g. R M.a g. F1 W.a g. P W.a g. R W.a g. F1
andom 93 91 89 90 93 93 93
di . use s 79 71 67 67 79 79 78
Chap e 5. Model expe imen a ion and e inemen 52
TABLE 5.8: Classi ica ion Repo s showing a e age pe o mance o LSTM
model ained a e ou lie s de ec ion
Class P ecision Recall F1-sco e Suppo
Bike 0.44 0.46 0.45 195
Bus 0.80 0.79 0.80 1957
Ca 0.85 0.92 0.88 1805
Mo o bike 0.47 0.45 0.46 171
Run 0.98 0.92 0.95 357
S a iona y 0.75 0.67 0.71 495
Subway 0.78 0.81 0.80 1781
T ain 0.44 0.18 0.25 349
T am 0.84 0.86 0.85 1152
Walk 0.87 0.91 0.89 1265
e-Scoo e 0.66 0.68 0.67 276
Accu acy 0.80 9803
Mac o a g 0.72 0.70 0.70 9803
Weigh ed a g 0.79 0.80 0.80 9803
5.1.7 Final con igu a ion o he baseline model
As a summa y o he p e ious sec ions, di e en con igu a ions o he p ep ocessing
s eps ha e been es ed. As a esul , i has been decided o es ablish he ollowing con-
igu a ion as he basis o he p ojec :
•Sepa a ion algo i hm: di e en use s sepa a ion.
•Windows size: 512
•O e lap ac o : 50%
•Da a augmen a ion: DAbase
•Smoo hing echniques: no smoo hing
•Ou lie s de ec ion echnique: Mahalanobis Dis ance
FIGURE 5.7: Lea ning cu es h oughou he di e en epochs o he model
ained using he inal con igu a ion.

Chap e 5. Model expe imen a ion and e inemen 53
In his i s expe imen , he implemen ed con igu a ion yielded an F-sco e o app oxi-
ma ely 80% and a mac o a e age F1-sco e o 70% . De ailed insigh s in o hese esul s
a e elabo a ed upon in p eceding sec ions. None heless, he e exis s subs an ial scope
o imp o emen . The con usion ma ix, as illus a ed in Figu e 5.8, e eals ce ain mis-
classi ica ions, no ably be ween anspo modes like ain and subway. An imp o emen
s a egy may in ol e al e a ions o he model a chi ec u e. Fo ins ance, employing esid-
ual ne wo ks could acili a e he ex ac ion o ea u es ac oss a ied scales. Addi ionally,
al e na i e a chi ec u es such as Con olu ional Neu al Ne wo ks (CNNs) migh p o e
mo e e icien in ea u e ex ac ion. A u he b anch o imp o emen lies in model ain-
ing. As depic ed in Figu e 5.7, he model exhibi s ea ly signs o o e i ing. This sugges s
ha he op imiza ion pa ame e s cu en ly in use a e subop imal, indica ing ano he po-
en ial a ea o e inemen . The subsequen expe imen s will del e in o hese aspec s,
using he pa ame e s es ablished in he cu en s udy as ounda ional benchma ks.
FIGURE 5.8: Con usion ma ix o he model ained using he inal con ig-
u a ion.
5.2 T adi ional machine lea ning baselines
Once he expe imen se up is se , he i s s udy o be ca ied ou is o es he e ec i e-
ness o machine lea ning models ained wi h he manually ex ac ed ea u es. Fo his,
he p ocess desc ibed in de ail in ?? will be ca ied ou . Wi h he con igu a ion o he
da ase se in he p e ious sec ion i has been ob ained ha he PCA manages o educe
he numbe o ea u es om 99 o 38 making he numbe o ea u es easible o aining
using adi ional a chi ec u es. On his basis, ou di e en models ha e been es ed: RF,
SVM,KNN and MLP. Fo all o hem, di e en combina ions o hype -pa ame e s ha e
been es ed using Random Sea ch [10], in o de o ob ain he maximum e ec i eness.
Chap e 5. Model expe imen a ion and e inemen 54
All es ed combina ions a e shown in Table 5.9. In addi ion, he pa ame e s ha esul in
he bes pe o mance o each model a e also highligh ed.
TABLE 5.9: Pa ame e se ings o SVM, RF, KNN, and MLP andom
sea ches. Bold alues indica e ha his is he inal alue chosen o each
pa ame e .
Model Pa ame e Values
SVM
C 0.1, 1, 10
ke nel b , poly
deg ee 2, 4
gamma scale, au o, 0.1, 1
RF
n_es ima o s 50, 100, 200, 500
max_ ea u es au o, sq , log2
max_dep h None, 15, 30, 50
min_samples_spli 2, 5, 10
min_samples_lea 1, 2, 3, 4
boo s ap T ue, False
KNN
n_neighbo s 1, 2, 3, 4, 5...31
weigh s uni o m, dis ance
me ic euclidean, manha an, minkowski
MLP n_neu ons [128, 64], [256, 128], [512, 256], [512, 512]
lea ning_ a e 0.001, 0.01, 0.1
The da a p esen ed in Table 5.10 clea ly demons a es he e icacy o manually ex ac ed
ea u es in anspo p edic ion o his da ase . No ably, he compu a ional esou ces e-
qui ed o aining hese models a e signi ican ly lowe compa ed o he LSTM app oach,
making i a iable al e na i e o sys ems cons ained by limi ed esou ces. Howe e , as
an icipa ed, he peak F1-sco e achie ed wi h hese models, a 76%, does no ma ch he
80% a ained by he p e iously discussed LSTM model. Despi e his, i emains a alu-
able app oach o assess he e o s in es ed in p io expe imen s. Mo eo e , hese esul s
se e as a use ul baseline o compa a i e analysis. Fo addi ional in o ma ion on he ac-
cu acy o he model in he di e en classes, he con usion ma ix is shown in Figu e 5.9.
TABLE 5.10: A e age pe o mance using adi ional machine lea ning a -
chi ec u es. (M.a g. means Mac o A e age and W.a g. means Weigh ed
A e age)
Model F1-sco e M.a g. P M.a g. R M.a g. F1 W.a g. P W.a g. R W.a g. F1
SVM 75 62 61 60 73 75 74
RF 76 64 62 61 75 76 75
KNN 74 61 60 60 73 74 73
MLP 76 64 65 64 77 76 76
Chap e 5. Model expe imen a ion and e inemen 55
FIGURE 5.9: Con usion ma ix o he p esen ed MLP model.
5.3 BiLSTM
In his expe imen , an enhancemen o he LSTM model’s pe o mance is ied h ough
he implemen a ion o a Bidi ec ional LSTM (BiLSTM) a chi ec u e. As de ailed in sub-
sec ion 2.4.6, he BiLSTM, unlike i s LSTM coun e pa , p ocesses da a sequences bidi ec-
ionally, po en ially o e ing a mo e comp ehensi e analysis o empo al da a pa e ns.
This esea ch in ol es a me iculous examina ion o a ious aining pa ame e s and a -
chi ec u al modi ica ions o op imize he model’s e icacy.
The explo a ion o aining me hodologies includes he e alua ion o di e en op imiza-
ion algo i hms, namely RMSp op and SGD [18]. Addi ionally, he in es iga ion ex ends
o assessing he impac o a ying lea ning a e alues on he model’s aining s abili y.
Fu he , he s udy inco po a es he weigh decay app oach and an adap i e momen-
um echnique, hough hese modi ica ions ini ially led o aining des abiliza ion. A
no able b eak h ough was achie ed wi h he adap a ion o he loss unc ion, inco po a -
ing class-weigh ing o less- ep esen ed classes in he aining se . This adjus men aims
o enhance he model’s sensi i i y o hese classes. Mo eo e , a smoo hing pa ame e is
in eg a ed in o he loss unc ion o mi iga e o e i ing. The bes esul s we e ob ained
wi h he ollowing con igu a ion:
•Op imize : Adam
•Lea ning a e: 0.001
•Ba ch size: 64
•Num. epochs: 70
•Loss unc ion: Weigh ed Ca ego ical C ossen opy
Chap e 5. Model expe imen a ion and e inemen 56
•Smoo hing pa ame e : 0.1
Figu e 5.10 shows he aining cu es h oughou he di e en epoa e aining he BiL-
STM model wi h he speci ied pa ame e s. As can be seen, compa ed o he cu e shown
in Figu e 5.7, he new loss unc ion is be e adap ed o he aining da a and he e o e
he aining is be e guided by i , showing a mo e s able aining.
FIGURE 5.10: Lea ning cu es h oughou he di e en epochs o he BiL-
STM model ained using he uned op imiza ion pa ame e s.
On he model side, he expe imen eplica es he s uc u e o he ini ial LSTM model
bu subs i u es LSTM laye s wi h BiLSTM laye s. Fu he mo e, he s udy del es in o
de e mining he op imal size o he BiLSTM laye s, ailo ed o he speci ics o he da ase
in use, hus seeking o maximize he model’s pe o mance. Fo his pu pose, h ee sizing
con igu a ions o he BiLSTM laye s ha e been es ed: [128, 128], [128, 256], [256, 256].
The esul s o he expe imen s wi h he di e en sizes a e shown in Table 5.11. Despi e he
e o s exe ed in es ing a ious hype -pa ame e con igu a ions, he bes esul s o he
expe imen s pe o med wi h his a chi ec u e do no su pass he p e ious bes esul s.
Howe e , hey a e ela i ely simila in he case o he second con igu a ion by using a
model wi h 700k less pa ame e s.
TABLE 5.11: A e age pe o mance using di e en sizes o he BiLSTM
laye s. (M.a g. means Mac o A e age and W.a g. means Weigh ed A e -
age)
Size Pa ams. F1-sco e M.a g. P M.a g. R M.a g. F1 W.a g. P W.a g. R W.a g. F1
[128, 128]0.5M 78 67 70 68 79 78 78
[128, 256] 1.1M 79 69 70 69 79 79 79
[256, 256]2.1M 78 68 69 68 77 78 77
5.4 Mixed model
This sec ion explo es a mixed a chi ec u e model, combining con olu ional and ecu -
en laye s, ollowing he ini ial es ing o models solely based on ecu en ne wo ks.
Fo his pu pose, we builded a base model inspi ed by he a chi ec u e p oposed by Tang
e Al. in [57]. Consequen ly, se e al expe imen s wi h a ia ions o his a chi ec u e and
i s hype -pa ame e s will be pe o med.
Chap e 5. Model expe imen a ion and e inemen 57
The designed a chi ec u e is shown in Figu e 5.11. The a chi ec u e depic ed akes in-
pu om he h ee senso s. Each senso eed passes h ough a se ies o con olu ional
blocks (Con Block), which a e likely composed o con olu ional laye s wi h ba ch no -
maliza ion, d opou , and max pooling as indica ed in he highligh ed key o one Con
Block. The Npa ame e co esponds o he numbe o il e s o he con olu ion and he K
pa ame e co esponds o he ke nel size. A e ea u e ex ac ion, he ou pu s o he con-
olu ional blocks om each senso channel a e conca ena ed and ed in o a LSTM laye .
Finally he e a e a dense laye (also known as a ully connec ed laye ), which p ocesses
he ea u es lea ned by he LSTM, and a dense ou pu laye wi h a so max ac i a ion
unc ion which ou pu s he p obabili ies o each anspo .
FIGURE 5.11: Base a chi ec u e diag am o he mixed model combining
LSTM and CNNs.
The p ima y goal o his mixed a chi ec u e is o syne gize he ea u e ex ac ion capa-
bili ies o con olu ional ne wo ks wi h he sequence p ocessing s eng hs o ecu en
ne wo ks. The aining pa ame e s selec ed o his s udy a e based on hose used in he

Chap e 5. Model expe imen a ion and e inemen 58
p e ious sec ion, wi h modi ica ions o op imize aining o deepe models. Speci ically,
he lea ning a e has been educed, and he numbe o epochs has been inc eased. The
aining pa ame e s o he expe imen s in his sec ion a e ou lined below:
•Op imize : Adam
•Lea ning Ra e: 1×10−4
•Ba ch Size: 64
•Numbe o Epochs: 100
•Loss Func ion: Weigh ed Ca ego ical C ossen opy
•Smoo hing Pa ame e : 0.1
To de elop he mos e ec i e classi ica ion model o his da ase , we conduc ed se e al
expe imen s in he ollowing sequence:
1. Regula iza ion: Tes ing a ious con igu a ions o p e en o e i ing, including
di e en D opou a es, lea ning a es, and o he egula iza ion echniques.
2. Con olu ional Block Va ia ions: Expe imen ing wi h di e en laye con igu a-
ions in he con olu ional block.
3. Ac i a ion Func ion Tuning: E alua ing a ious ac i a ion unc ions, including
ReLU, Leaky ReLU, and GeLU.
4. Recu en Block Va ia ions: Assessing di e en app oaches in he ecu en laye ,
such as LSTM, BiLSTM, and a ligh weigh model wi hou a ecu en laye .
5.4.1 Regula iza ion
Regula iza ion in Deep Lea ning is known as a echnique used o p e en o e i ing.
Regula iza ion wo ks by adding addi ional in o ma ion o cons ain s o he model o
simpli y i , making i less likely o cap u e he noise in he aining da a. The wo ech-
niques co e ed by his expe imen a e D opou and L2 egula iza ion. D opou [54] an-
domly skip neu ons du ing aining, which helps in p e en ing o e - eliance on any one
node and encou ages a dis ibu ed ep esen a ion o ea u es. A a ia ion o he classic
d opou echnique is he Spa ial d opou [38]. I add esses he s uc u e aspec s o CNNs
by d opping ou en i e ea u e maps om he con olu ional laye s ins ead o indi idual
neu ons. This o ces he ne wo k o main ain obus ness no jus a he neu on le el bu
also a a highe le el o abs ac ion On he o he hand, L2 egula iza ion [15] adds he
squa ed alue o he weigh s o he loss unc ion. I encou ages he model weigh s o be
small, bu no necessa ily ze o.
The expe imen al amewo k o his s udy in ol es a ying d opou a ios and assess-
ing he po en ial syne gy o combining bo h egula iza ion echniques. The conduc ed
expe imen s include:
• Classical D opou a d opou a es o 20% and 10%.
• Spa ial D opou a d opou a es o 10% and 5%.
• Combina ion o Spa ial D opou and L2 egula iza ion.
Chap e 5. Model expe imen a ion and e inemen 59
Resul s, as de ailed in Table 5.12, sugges ha bo h Spa ial D opou and L2 egula iza ion
con ibu e o imp o ed model gene aliza ion. No ably, d opou a es exceeding 20% no
allows he model o lea n ine g ain da a ea u es. An analysis o he lea ning cu es u -
he elucida es hese indings. The compa ison o he lea ning cu es e eals ha a 20%
d opou a e leads o s agnan loss oscilla ions, impeding lea ning. In con as , lowe
spa ial d opou a es exhibi mo e dynamic aining p og ess and enhanced lea ning ca-
pabili ies.
TABLE 5.12: A e age pe o mance wi h each o he egula iza ion me hods
in he mixed model. (M.a g. means Mac o A e age and W.a g. means
Weigh ed A e age) (Dp e e s o he d opou a e, SDp e e s o he Spa ial
d opou a e and L2 e e s o he L2 egula iza ion pa ame e )
Con igu a ion F1-sco e M.a g. P M.a g. R M.a g. F1 W.a g. P W.a g. R W.a g. F1
Dp: 0 74 66 67 67 74 74 74
Dp: 0.2 70 60 63 60 71 70 69
Dp: 0.1 74 64 66 65 75 74 74
SDp: 0.1 75 66 66 66 75 75 75
SDp: 0.05 75 67 68 67 76 75 75
SDp: 0.05, L2: 0.001 76 69 69 68 76 76 76
A de ailed assessmen o he egula iza ion echniques’ e ec i eness is acili a ed h ough
an examina ion o he lea ning cu es. Compa a i e analysis o Figu e 5.12 and Fig-
u e 5.13 e eals dis inc ou comes o di e en d opou a es. Speci ically, a a 20%
d opou a e (Figu e 5.12), he loss exhibi s pe sis en oscilla ion wi hin a na ow ange,
indica i e o he model’s inabili y o e ec i ely lea n om he aining da a. Con e sely,
Figu e 5.13, ep esen ing a scena io wi h a educed spa ial d opou a e, demons a es a
mo e dynamic aining p ocess. Despi e some ins abili y, his lowe d opou a e is asso-
cia ed wi h enhanced lea ning ou comes. The luc ua ion in loss, al hough p esen , does
no hinde he model’s lea ning capaci y o he same ex en as obse ed in he highe
d opou a e scena io. Wi h all his in mind, he con igu a ion chosen o con inue wi h
he ollowing expe imen s is 5% spa ial d opou , combined wi h L2 egula iza ion in
he ully connec ed laye .
FIGURE 5.12: Lea ning cu es h oughou he di e en epochs o he
mixed model ained using using a d opou a e o 20%.
Chap e 5. Model expe imen a ion and e inemen 60
FIGURE 5.13: Lea ning cu es h oughou he di e en epochs o he
model mixed ained using using a spa ial d opou a e o 5%.
5.4.2 Con olu ional Block Va ia ions
The con olu ional block is he mos impo an pa o he model o ea u e ex ac ion.
The achie emen o hese blocks should allow he model o ex ac he ea u es om
he da a ha allow he es o he model o di e en ia e be ween he a ious modes o
anspo .
This sec ion de ails he explo a ion o di e en con igu a ions o con olu ional blocks,
ocusing on laye a angemen s and con olu ion laye pa ame e s. The conduc ed expe -
imen s, aimed a op imizing ea u e ex ac ion capabili ies, a e summa ized as ollows:
• A compa ison o classical con olu ions and dila ed con olu ions, wi h an inc eas-
ing dila ion a e co ela ing o block dep h: 2, 4, 8, 8. De ails on dila ed con olu ions
a e p o ided in subsec ion 2.4.3.
• Va ia ions in ke nel size o con olu ions: [10, 7, 5, 5, 5] compa ed o [7, 5, 3, 3].
• Implemen ing mul iple con olu ions wi hin each con olu ional block.
• In es iga ing he op imal placemen o he ba ch no maliza ion laye , whe he be-
o e o a e he con olu ion p ocess.
These expe imen s ha e been un sequen ially, so ha o each expe imen he pa ame-
e s o he p e ious bes expe imen a e e ained. As can be seen in he esul s able (see
Table 5.13), he dila ed con olu ions a e a g ea imp o emen in he capabili ies o he
model o ex ac ea u es om a la ge s eam o empo al da a. In addi ion, he inc eased
dila ion a io helps he model o ex ac ea u es a di e en le els in each block o con-
olu ions. In con as , i has been obse ed ha a highe numbe o con olu ions s aked
in he same block does no help o imp o e he esul s. On he o he hand, i has been
de ec ed ha he bes posi ion o he ba ch no maliza ion laye is be o e he con olu ion
o his pa icula a chi ec u e.
Chap e 5. Model expe imen a ion and e inemen 61
TABLE 5.13: A e age pe o mance wi h each o he con olu ional block
con igu a ions in he mixed model. (M.a g. means Mac o A e age and
W.a g. means Weigh ed A e age) (The di e ence be ween he second and
he hi d expe imen is ha in he hi d expe imen an ex a con olu ion
pe block is added)
Con igu a ion F1-sco e M.a g. P M.a g. R M.a g. F1 W.a g. P W.a g. R W.a g. F1
dila ions [10, 7, 5, 5] 78 67 68 67 78 78 78
dila ions [7, 5, 3, 3] 80 70 69 69 80 80 80
dila ions [7, 5, 3, 3] x2 80 68 67 67 78 80 79
dila ions [7, 5, 3, 3], BN a e con 80 70 68 68 79 80 79
As a esul , he bes con igu a ion ex ac ed om his pa o he s udy is he one using
dila ed con olu ions wi h ke nel sizes o 7, 5 and 3, and wi h he ini ial block’s s uc u e.
5.4.3 Ac i a ion Func ion Tuning
The ac i a ion unc ion in an a i icial neu al ne wo k node is a ma hema ical unc ion
ha de e mines he ou pu o ha node gi en a se o inpu s and hei co esponding
weigh s. This unc ion plays a c ucial ole in he ne wo k’s abili y o cap u e and ep e-
sen complex pa e ns and ela ionships in he da a. I in oduces non-linea i y in o he
model, enabling he ne wo k o lea n and pe o m mo e han jus simple linea ans o -
ma ions.
This is why his sec ion has been de o ed o es ing a ia ions o he ac i a ion unc ion
o he con olu ion laye s and he ully connec ed laye . In his case i has been decided
o expe imen wi h ReLU, Leaky ReLU [63] and GeLU [30] as ac i a ion unc ions.
•ReLU (Rec i ied Linea Uni ): De ined as (x) = max(0, x), ReLU is e icien , se -
ing nega i e inpu s o ze o and keeping posi i e alues unchanged. I aids in al-
le ia ing he anishing g adien p oblem bu can cause inac i e neu ons due o i s
ze o ou pu o nega i e alues.
•Leaky ReLU: I modi ies ReLU by allowing a small g adien when inac i e, de ined
as (x) = x o x>0 and (x) = αx o x≤0, whe e αis a small cons an . This
p e en s neu ons om becoming inac i e.
•GELU (Gaussian E o Linea Uni ): A smoo he unc ion de ined as (x) = xΦ(x),
wi h Φ(x)being he Gaussian dis ibu ion’s cumula i e dis ibu ion unc ion. GELU
allows p obabilis ic ga ing o inpu s, o e ing nuanced ac i a ion beha io and demon-
s a ing e icacy especially in na u al language p ocessing.
TABLE 5.14: A e age pe o mance wi h each o he ac i a ion unc ions
in he mixed model. (M.a g. means Mac o A e age and W.a g. means
Weigh ed A e age)
Ac . Fun. F1-sco e M.a g. P M.a g. R M.a g. F1 W.a g. P W.a g. R W.a g. F1
ReLU 80 70 69 69 80 80 80
Leaky ReLU 79 69 69 68 79 79 79
GELU 78 67 68 67 78 78 78
Chap e 5. Model expe imen a ion and e inemen 68
he same Huawei Ma e 9 sma phone. The e o e, his would no be a good ep ese a i e
da ase o be used as a s a ing da ase o a and e lea ning p ocess ollowed by a ine
uning hase wi h he own da ase . This is p ecisely one o ou aims in he Mobili App [2]
p ojec in collabo a ion wi h he ATM, we aim o gene a e a la ge ep esen a i e da ase
o u ban mobili y da a collec ed om a huge numbe o ci izens in Ba celona. Thus, ou
Mobili App public da ase could be used by o he esea che s and u ban planne s as a
s a ing poin o de elope hei pa icula p edic e machine lea ning based models. Re-
u ning o he SHL da ase , he da a dis ibu ion, depic ed in Figu e 5.19, e eals ha he
p e iew da ase , despi e being p elimina y, encompasses mo e hou s o da a o mos
anspo modes compa ed o o he da ase s. Howe e , i co e s a smalle ange o ans-
po ypes.
FIGURE 5.19: Dis ibu ions o he ac i i ies in he SHL P e iew da ase .
[60]
The me hodology employed in ol ed u ilizing he model con igu a ion es ablished in
he p eceding sec ion, he hie a chical model in Figu e 5.16, main aining iden ical pa-
ame e s and aining algo i hms. Fo his speci ic i e a ion, a aining du a ion o 25
epochs p o ed su icien o yield no able esul s on he SHL p e iew da ase . The e ec-
i eness o his app oach is e iden in he lea ning cu es depic ed in Figu e 5.20 and
he con usion ma ix p esen ed in Figu e 5.21, whe e he model achie ed an F1-sco e o
92%. This ou come unde sco es he model’s p o iciency in adap ing o and pe o ming
well on he da ase in ques ion. No e, howe e , ha his da ase is composed o da a
gene a ed by only 3 use s and all o hem use he same sma phone model. The e o e, i s
ep esen a i eness and use ulness is limi ed.
FIGURE 5.20: Lea ning cu es h oughou he di e en epochs o he hie -
a chical model ained in he SHL p e iew da ase .

Chap e 5. Model expe imen a ion and e inemen 69
FIGURE 5.21: Con usion ma ix o he hie a chical model ained in he
SHL p e iew da ase .
Once he base model was ob ained, i was decided o pe o m ine uning by eezing he
con olu ional blocks and educing he lea ning a e o 0.5e-4. This is a e y common
p ac ice in ine uning. This app oach solidi ies he ea u e ex ac ion mechanism and
eases he aining p ocess by main aining ce ain ini ial weigh s o he model. Howe e ,
no be e esul s han hose ob ained p e iously ha e been achie ed, wi h he F1-sco e
s opped a 76%. This may be due o he ac ha he ask ca ied ou wi h he p e iew
da ase is clea ly easie o comple e han he one p oposed in his p ojec , since i has
ewe modes o anspo , a educed numbe o use s and a single mobile de ice. Fu he
de ails o he esul s o his expe imen a e shown in Figu e 5.22 and Figu e 5.23.
FIGURE 5.22: Lea ning cu es h oughou he di e en epochs o he hie -
a chical model ained in he SHL p e iew da ase and ine uned.
Chap e 5. Model expe imen a ion and e inemen 70
FIGURE 5.23: Con usion ma ix o he hie a chical model ained in he
SHL p e iew da ase and ine uned.
5.7 Resul s discussion
This sec ion del es in o a compa a i e analysis o ou dis inc models, e alua ed h ough
a obus me hodological amewo k. The app oach adop ed o his compa ison in ol ed
g oup- old c oss- alida ion wi h i e olds, execu ed ac oss h ee di e en andom seeds.
This p ocedu e culmina ed in a o al o 15 uns pe model, ensu ing a comp ehensi e
assessmen o each model’s pe o mance consis ency and esilience o a ying da a spli s.
In pa icula , he models compa ed in his sec ion a e he wo bes models o he p e ious
sec ions and he wo baseline models: he LSTM baseline om subsec ion 5.1.7, he MLP
baseline om sec ion 5.2, he mixed model om subsec ion 5.4.4 and he hie a chical
model om sec ion 5.5.
To asce ain s a is ically signi ican di e ences in pe o mance among he models, he
Mann-Whi ney U es [45] was u ilized, as explained in subsec ion 2.5.4. This non-
pa ame ic es is pa icula ly adequa e o his analysis, gi en i s sui abili y o com-
pa ing dis ibu ions wi hou he need o no mali y assump ions. Each model’s se o
F1-sco es ac oss he 15 uns was compa ed agains hose o he o he models, using he
Mann-Whi ney U es o de e mine i any obse ed di e ences in pe o mance we e s a-
is ically signi ican o me ely he esul o andom a ia ion.
To begin wi h he analysis, as a eminde o he p e ious sec ions, Table 5.19 shows a
summa y o he esul s ob ained wi h he models men ioned abo e. Howe e , as al eady
men ioned, no empi ical conclusions can be d awn om me ics alone. In con as , Ta-
ble 5.20 shows he s a is ical compa ison be ween he hie a chical model, which seems o
be he bes acco ding o he me ics, and all he o he models. In his con ex , he p- alue
Chap e 5. Model expe imen a ion and e inemen 71
co esponds o he p obabili y ha he obse ed esul s would occu unde he null hy-
po hesis, which in his case is he assump ion ha he e is no di e ence be ween he wo
models. To in e p e his alue, 0.05 is no mally used as a h eshold. Consequen ly, a
alue below his h eshold indica es ha he obse ed da a is e y unlikely unde he
null hypo hesis. This leads o he ejec ion o he null hypo hesis, sugges ing ha he e is
a s a is ically signi ican di e ence be ween he wo models. As can be seen in he able
all p- alues a e below his h eshold which indica es ha he di e ence in he esul s o
he hie a chical model is signi ican enough o con i m ha his model o e s be e
esul s o e all o hese da a in his ask.
TABLE 5.19: Summa y o he a e age pe o mance wi h each o he LSTM
baseline om subsec ion 5.1.7, he MLP baseline om sec ion 5.2, he
mixed model om subsec ion 5.4.4 and he hie a chical model om sec-
ion 5.5. Resul s ob ained om p e ious sec ions. (M.a g. means Mac o
A e age and W.a g. means Weigh ed A e age)
Model Pa ams. F1-sco e M.a g. P M.a g. R M.a g. F1 W.a g. P W.a g. R W.a g. F1
LSTM baseline 1.8M 80 72 70 70 79 80 80
MLP baseline 0.01M 76 64 65 64 77 76 76
Mixed model 2.4M 80 70 69 69 80 80 80
Hie a chical model 1.3M 82 72 72 72 71 81 82
TABLE 5.20: P- alues esul ing om compa ing he highligh ed models
wi h he hie a chical model om sec ion 5.5 using he Mann-Whi ney U
es [45]. No e ha a alue below 0.05 indica es a signi ican di e ence in
he esul s.
Models p- alue
LSTM baseline - Hie a chical model 3.57e−5
MLP baseline - Hie a chical model 3.39e−6
Mixed model - Hie a chical model 4.2e−3
On he o he hand, o a mo e illus a i e iew o he compa a i e models, Figu e 5.24 is
shown. Each box in he plo delinea es he in e qua ile ange (IQR) o he F1-sco es, wi h
he median alue conspicuously ma ked by a cen al ho izon al line. The "whiske s" o
he plo ex end o co e he ull sp ead o he da a, p o iding insigh in o he a iabili y
and eliabili y o each model. This g aphical ep esen a ion is c ucial o unde s anding
he compa a i e s eng hs and po en ial limi a ions o each model, and in his one i
can be seen ha o mos cases he hie a chical model is supe io o he o he s, which
indica es ha i is he one ha o e s he bes pe o mance.
Finally, o conclude he s udy, we wan ed o show he pe o mance o he hie a chical
model applied o each o he senso s sepa a ely, as shown in Figu e 5.25. I can be seen
ha each o he senso s sepa a ely is no able o ob ain good esul s, which indica es ha
each o hem is use ul o anspo mode classi ica ion since he combina ion o hem
esul s in a much highe pe o mance.
Chap e 5. Model expe imen a ion and e inemen 72
FIGURE 5.24: Box plo depic ing he F1-sco es o he LSTM baseline om
subsec ion 5.1.7, he MLP baseline om sec ion 5.2, he mixed model om
subsec ion 5.4.4 and he hie a chical model om sec ion 5.5. The cen al
line in each box ep esen s he median F1-sco e, he edges o he boxes
indica e he in e qua ile ange, and he whiske s ex end o he ull ange
o he da a, excluding ou lie s.
FIGURE 5.25: Ba cha compa ing he pe o mance o he hie a chical
model om sec ion 5.5 using only one senso . (M.a g. means Mac o A e -
age and W.a g. means Weigh ed A e age)
Chap e 5. Model expe imen a ion and e inemen 73
5.7.1 Final Hie a chical model e alua ion
As a eminde om sec ion 5.5, he hie a chical model combines con olu ional ne wo ks
wi h LSTM in a py amidal s uc u e ha allows he p ocessing o he ex ac ed ea u es a
di e en le els using skip connec ions. The inal con igu a ion o he model is as ollows:
•LSTM size: 128
•Numbe o il e s in CNN: N = [32, 64, 128, 128, 512, 256]
•Ke nel size: K=[7,5,3,3]
•Dila ed con olu ions
•Ac i a ion unc ion: ReLU
•Regula iza ion: Spa ial d opou o 5% and L2 egula ize o 0.001
•Op imize : Adam wi h 1e-4 o lea ning a e
•Loss Func ion: Weigh ed Ca ego ical C ossen opy wi h 0.1 o smoo hing
•Numbe o epochs: 100
•Ba ch size: 64
A e all he p e ious analysis he las hing o do is o e alua e he inal model (hie a -
chical model) in he es ing se . The ob ained pe o mance is depic ed in Table 5.21 and
Figu e 5.26. As a summa y, he di e ence be ween he alida ion and es esul s is small,
indica ing ha he model has no been o e i ed o he alida ion es .
TABLE 5.21: Classi ica ion Repo o he hie a chical model om sec-
ion 5.5 on he es se .
Class P ecision Recall F1-sco e Suppo
Bike 0.59 0.40 0.48 198
Bus 0.84 0.80 0.82 1866
Ca 0.84 0.91 0.87 1818
Mo o bike 0.50 0.51 0.50 199
Run 0.98 0.93 0.96 305
S a iona y 0.66 0.74 0.70 598
Subway 0.86 0.79 0.82 1835
T ain 0.21 0.07 0.11 326
T am 0.86 0.93 0.90 1194
Walk 0.86 0.94 0.90 1215
e-Scoo e 0.57 0.80 0.67 251
Accu acy 0.81 9805
Mac o a g 0.71 0.71 0.70 9805
Weigh ed a g 0.80 0.81 0.80 9805

Chap e 5. Model expe imen a ion and e inemen 74
FIGURE 5.26: Con usion ma ix o he hie a chical model om sec ion 5.5
on he es se .
75
Chap e 6
Mobili App ool o ecogni ion o
anspo a ion modes
While he deep lea ning model cons i u es he co ne s one o p edic ing anspo a ion
modes, i s p ac ical applica ion necessi a es in eg a ion wi hin a comp ehensi e sys em.
This sys em encompasses se e al c i ical componen s, including eal- ime da a acqui-
si ion, p ep ocessing, he anspo p edic ion, and eedback o he use . This chap e
de ails he de elopmen and implemen a ion o an And oid applica ion named Mobili-
App [2], embodying an end- o-end sys em ha seamlessly in eg a es da a collec ion and
model e alua ion p ocesses.
The subsequen con en o his chap e is go e ned by a con iden iali y ag eemen .
76
Chap e 7
E hical and en i onmen al conce ns
In anspo mode de ec ion sys ems se ing up a balance be ween echnological ad ance-
men and e hical, en i onmen al esponsibili y is a pa amoun conce n. This chap e
del es in o he mul i ace ed e hical and en i onmen al conside a ions su ounding he
deploymen and ope a ion o hese sys ems, es ablishing a guideline ha ensu e ai use,
secu e da a s o age, en i onmen al s ewa dship, and sus ainable p ac ices.
7.1 E hical conside a ions
This sec ion examines he e hical conside a ions speci ic o he applica ion o A i icial
In elligence (AI) in anspo mode de ec ion sys ems. Add essing hese e hical aspec s
is c ucial o ensu e he esponsible deploymen and accep ance o such echnologies in
u ban en i onmen s. The main aspec s o ake in o accoun when alking abou e hics
applied o he s udy o a i icial in elligence a e: p i acy, in e p e abili y and secu i y.
7.1.1 P i acy
As seen in he p e ious chap e s, he main applica ions o anspo mode de ec ion sys-
ems in ol e moni o ing he ac i i ies o humans du ing hei ip. Since he manne o
d i ing, walking, unning, o e en using a phone on public anspo changes be ween
use s, i may be possible o an ad e sa y o in e om iangula ions be ween samples
which sample belongs o which use .
Speci ically, in he case o deep lea ning-based sys ems, he cha ac e is ics o hese mod-
els pose a isk o he disclosu e o sensi i e use cha ac e is ics. Iwasawa e Al. in [32]
in es iga ed he p i acy issue o using Con olu ional Neu al Ne wo ks as human ac-
i i y ecogni ion models. Thei s udies e ealed ha , al hough he CNN was ini ially
ained using a c oss-en opy loss ocused solely on ac i i y classi ica ion, he esul ing
CNN ea u es unexpec edly demons a ed a signi ican capaci y o use disc imina ion.
U ilizing hese CNN ea u es, a s aigh o wa d logis ic eg esso was able o a ain an
imp essi e 84.7% accu acy in classi ying use s. This con as s ma kedly wi h he meage
35.2% accu acy achie ed by he same classi ie when applied o aw senso da a. Conse-
quen ly, i becomes c ucial o conside and add ess he po en ial p i acy isks inhe en in
deep lea ning models o iginally designed o his ask.
Chap e 7. E hical and en i onmen al conce ns 77
The e a e mul iple b anches o s udy in he ield o da a p i a iza ion. And in his sec ion,
we will co e wo o hem: T ans o ma ions and Pe u ba ion. In he case o T ans o -
ma ion. his echnique in ol es using an ad e sa ial loss unc ion du ing he aining
p ocess o a model o minimize he accu acy o iden i ying speci ic p i a e in o ma ion.
This me hod was explo ed by esea che s like Iwasawa e al. [32], who in eg a ed ad e -
sa ial loss wi h s anda d ac i i y classi ica ion loss o educe use iden i ica ion accu acy.
Howe e , ad e sa ial loss unc ions can complica e he end- o-end aining p ocess, o -
en leading o uns able con e gence.
On he o he hand, Pe u ba ion is an al e na i e s a egy o da a ans o ma ion o ad-
d essing p i acy conce ns in ac i i y ecogni ion. This me hod in ol es modi ying da a
o balance p i acy wi h ecogni ion accu acy. Lyu e al. [41] in oduced wo da a pe u -
ba ion mechanisms: Random P ojec ion and Repea ed Gompe z, aiming o achie e an
op imal balance be ween main aining p i acy and ensu ing accu a e ecogni ion. Ran-
dom P ojec ions educe da a dimensionali y by p ojec ing i on o a lowe -dimensional
space using andom ma ices, main aining dis ance ela ionships while enhancing p i-
acy. In case o Repea ed Gompe z, a ma hema ical model is applied, ypically used o
g ow h p ocesses, o sys ema ically al e da a, obscu ing speci ic ea u es while p ese -
ing use ul s a is ical p ope ies.
7.1.2 In e p e abili y
Senso y da a is un eadable o humans, specially in he case whe e mo e han one sen-
so is used in a ime window. Gi en he di e ing impo ance o modali ies and ime
in e als, in e p e ing neu al ne wo ks is essen ial o unde s and he unde lying ac o s
in luencing model decisions. Fo ins ance, in iden i ying a use ’s ac i i y like walking, i
is c ucial o de e mine which speci ic modali y and ime in e al a e key de e minan s.
As a esul , enhancing he in e p e abili y o deep lea ning me hods is eme ging as a
signi ican end wi hin he anspo mode ecogni ion communi y. Some p og ess has
been made in his ield and he e a e se e al ways o ep esen model knowledge. We a e
p esen ing Fea u e Visualiza ion and A en i e Selec ion.
Fea u e Visualiza ion in he con ex o in e p e able deep lea ning in ol es illus a ing
how neu al ne wo ks p io i ize and p ocess di e en pa s o inpu da a. The co e con-
cep is o au oma ically disce n he impo ance o each inpu segmen , ocusing on salien
pa s o imp o ed accu acy while dis ega ding less impo an elemen s. Resea che s
ha e de eloped me hods o isually ep esen hese ea u es, allowing o an unde -
s anding o how ce ain ea u es co ela e wi h speci ic ac i i ies. Addi ionally, ech-
niques like hose p oposed by Nu e e al. [47] in ol e ans o ming senso y da a in o
image o ma s, enabling he applica ion o isualiza ion ools o mo e s aigh o wa d
in e p e abili y o he da a.
On he o he hand, A en i e Selec ion applies neu al a en ion mechanisms o deep
lea ning models, enabling hem o concen a e on a subse o inpu s conside ed mos
ele an . Va ious s udies ha e u ilized he a en ion mechanism as a ool o in e p e ing
he beha io s o deep models, p o iding insigh s in o which aspec s o he inpu da a he
models conside mos c i ical o hei decision-making p ocesses [65].
BIBLIOGRAPHY 84
[27] Ian Good ellow, Yoshua Bengio, and Aa on Cou ille. Deep Lea ning. MIT P ess,
2016. h p://www.deeplea ningbook.o g.
[28] M.A. Hea s , S.T. Dumais, E. Osuna, J. Pla , and B. Scholkop . Suppo ec o ma-
chines. IEEE In elligen Sys ems and hei Applica ions, 13(4):18–28, 1998.
[29] Samuli Hemminki, Pe e i Nu mi, and Sasu Ta koma. Accele ome e -based ans-
po a ion mode de ec ion on sma phones. 11 2013.
[30] Dan Hend ycks and Ke in Gimpel. B idging nonlinea i ies and s ochas ic egula -
ize s wi h gaussian e o linea uni s. CoRR, abs/1606.08415, 2016.
[31] IBM. Deep lea ning: wha is and how i wo ks, 2021. Accessed: 2023-10-04.
[32] Yusuke Iwasawa, Ko a o Nakayama, Ikuko Yai i, and Yu aka Ma suo. P i acy issues
ega ding he applica ion o dnns o ac i i y- ecogni ion using wea ables and i s
coun e measu es by use o ad e sa ial aining. pages 1930–1936, 08 2017.
[33] Jaume Planas i Planas. T eball de Final de Màs e . Imp o ing he Mobili App ool
using deep lea ning models o au oma ically iden i y ci izens ac i i y including
sus ainable anspo modes. h ps://upcommons.upc.edu/handle/2117/382385,
2021.
[34] J. Jeyakuma , Eun Sun Lee, Zhengxu Xia, Sandeep Singh Sandha, Na han Tausik,
and Mani B. S i as a a. Deep con olu ional bidi ec ional ls m based anspo a ion
mode ecogni ion. P oceedings o he 2018 ACM In e na ional Join Con e ence and 2018
In e na ional Symposium on Pe asi e and Ubiqui ous Compu ing and Wea able Compu -
e s, 2018.
[35] And ej Ka pa hy, Jus in Johnson, and Li Fei-Fei. Visualizing and unde s anding
ecu en ne wo ks. CoRR, abs/1506.02078, 2015.
[36] Jenni e R. Kwapisz, Ga y M. Weiss, and Samuel Moo e. Ac i i y ecogni ion using
cell phone accele ome e s. SIGKDD Explo ., 12:74–82, 2011.
[37] Yann LeCun, Y. Bengio, and Geo ey Hin on. Deep lea ning. Na u e, 521:436–44, 05
2015.
[38] Sanghun Lee and Chulhee Lee. Re isi ing spa ial d opou o egula izing con olu-
ional neu al ne wo ks. Mul imedia Tools and Applica ions, 79:1–13, 12 2020.
[39] Xinyu Li, Yuan He, and Xiaojun Jing. A su ey o deep lea ning-based human ac-
i i y ecogni ion in ada . Remo e. Sens., 11:1068, 2019.
[40] Huichao Liu, Ying Feng, and Liguo Zhang. T anspo a ion mode iden i ica ion
based on sma phone. P oceedings o he Wo ld Cong ess on In elligen Con ol and
Au oma ion (WCICA), 2015:5349–5354, 03 2015.
[41] Lingjuan Lyu, Xuanli He, Yee Wei Law, and Ma imu hu Palaniswami. P i acy-
p ese ing collabo a i e deep lea ning wi h applica ion o human ac i i y ecog-
ni ion. pages 1219–1228, 11 2017.
[42] G. Mclachlan. Mahalanobis dis ance. Resonance, 4:20–26, 06 1999.
[43] ABC Mo o . Ciudades españolas con más a ascos a ascos, 2023. Accessed: 2023-10-
19.

BIBLIOGRAPHY 85
[44] Abdulmajid Mu ad and Jae-Young Pyun. Deep ecu en neu al ne wo ks o hu-
man ac i i y ecogni ion. Senso s, 17:2556, 11 2017.
[45] Nadim Nacha . The Mann-Whi ney U: A Tes o Assessing Whe he Two Indepen-
den Samples Come om he Same Dis ibu ion. Tu o ials in Quan i a i e Me hods o
Psychology, 4, 03 2008.
[46] Ben Nham, Kanya Siangliulue, and Se ena Yeung. P edic ing mode o anspo
om iphone accele ome e da a. 04 2012.
[47] Ma k Nu e , Ca he ine H. C aw o d, and Jo ge O iz. Design o no el deep lea ning
models o eal- ime human ac i i y ecogni ion wi h mobile phones. 2018 In e na-
ional Join Con e ence on Neu al Ne wo ks (IJCNN), pages 1–8, 2018.
[48] Tsuyoshi Oki a and Sozo Inoue. Recogni ion o mul iple o e lapping ac i i ies using
composi ional cnn-ls m model. pages 165–168, 09 2017.
[49] Ped egosa, F. and Va oquaux, G. and G am o , A. and Michel, V. and Thi ion, B.
and G isel, O. and Blondel, M. and P e enho e , P. and Weiss, R. and Dubou g, V.
and Vande plas, J. and Passos, A. and Cou napeau, D. and B uche , M. and Pe o ,
M. and Duchesnay, E. Sciki -lea n: Machine Lea ning in Py hon, 2011.
[50] Nishkam Ra i, Nikhil Dandeka , P ee ham Myso e, and Michael Li man. Ac i i y
ecogni ion om accele ome e da a. olume 3, pages 1541–1546, 01 2005.
[51] Zabic M Rosenbe g Randle L., Bundgaa d Wansche J. Dis ibu ed a el mode
es ima ion. 2012.
[52] Sima Siami-Namini, Neda Ta akoli, and Akba Siami Namin. The pe o mance o
ls m and bils m in o ecas ing ime se ies. In 2019 IEEE In e na ional con e ence on big
da a (Big Da a), pages 3285–3292. IEEE, 2019.
[53] Xuan Song, Hi oshi Kanasugi, and Ryosuke Shibasaki. Deep anspo : P edic ion
and simula ion o human mobili y and anspo a ion mode a a ci ywide le el. In
In e na ional Join Con e ence on A i icial In elligence, 2016.
[54] Ni ish S i as a a, Geo ey Hin on, Alex K izhe sky, Ilya Su ske e , and Ruslan
Salakhu dino . D opou : A simple way o p e en neu al ne wo ks om o e i ing.
Jou nal o Machine Lea ning Resea ch, 15(56):1929–1958, 2014.
[55] Ral S audemeye and E ic Mo is. Unde s anding ls m – a u o ial in o long sho -
e m memo y ecu en neu al ne wo ks. 09 2019.
[56] Qin ui Tang and Hao Cheng. Fea u e py amid bils m: Using sma phone senso s
o anspo a ion mode de ec ion, 2023.
[57] Qin ui Tang, Kanwal Jahan, and Michael Ro h. Deep cnn-bils m model o ans-
po a ion mode de ec ion using sma phone accele ome e and magne ome e . 06
2022.
[58] TomTom. Tom om a ic index: Measu ing conges ion wo ldwide. h ps://www.
om om.com/ a ic-index/, 2023. Accessed: 2023-10-19.
BIBLIOGRAPHY 86
[59] Ashish Vaswani, Noam Shazee , Niki Pa ma , Jakob Uszko ei , Llion Jones, Aidan N
Gomez, Łukasz Kaise , and Illia Polosukhin. A en ion is all you need. Ad ances in
neu al in o ma ion p ocessing sys ems, 30, 2017.
[60] Lin Wang, H is ijan Gjo eski, Ma hias Cilibe o, Paula Lago, Kazuya Mu ao,
Tsuyoshi Oki a, and Daniel Roggen. Th ee-yea e iew o he 2018–2020 SHL chal-
lenge on anspo a ion and locomo ion mode ecogni ion om mobile senso s. 6
2020.
[61] Yanwen Wang and Yuanqing Zheng. Modeling id signal e lec ion o con ac -
ee ac i i y ecogni ion. P oceedings o he ACM on In e ac i e, Mobile, Wea able and
Ubiqui ous Technologies, 2:1 – 22, 2018.
[62] Paul J We bos. Backp opaga ion h ough ime: wha i does and how o do i . P o-
ceedings o he IEEE, 78(10):1550–1560, 1990.
[63] Bing Xu, Naiyan Wang, Tianqi Chen, and Mu Li. Empi ical E alua ion o Rec i ied
Ac i a ions in Con olu ional Ne wo k, 2015.
[64] Fishe Yu and Vladlen Kol un. Mul i-scale con ex agg ega ion by dila ed con olu-
ions, 2016.
[65] Dalin Zhang, Lina Yao, Kaixuan Chen, Sen Wang, Pa i Deli Haghighi, and Ca-
ley Sulli an. A g aph-based hie a chical a en ion model o mo emen in en ion
de ec ion om eeg signals. IEEE T ansac ions on Neu al Sys ems and Rehabili a ion
Enginee ing, 27(11):2247–2253, 2019.
[66] Min-Ling Zhang and Zhi-Hua Zhou. Ml-knn: A lazy lea ning app oach o mul i-
label lea ning. Pa e n Recogni ion, 40(7):2038–2048, 2007.
[67] Fuzhen Zhuang, Zhiyuan Qi, Keyu Duan, Dongbo Xi, Yongchun Zhu, Hengshu
Zhu, Hui Xiong, and Qing He. A comp ehensi e su ey on ans e lea ning. CoRR,
abs/1911.02685, 2019.