• Nenhum resultado encontrado

Mobile System For Monitoring Driver' Behavior

N/A
N/A
Protected

Academic year: 2021

Share "Mobile System For Monitoring Driver' Behavior"

Copied!
161
0
0

Texto

(1)

F

ACULDADE DE

E

NGENHARIA DA

U

NIVERSIDADE DO

P

ORTO

Mobile System For Monitoring Driver’

Behavior

Joel Matos Vaz

Mestrado Integrado em Engenharia Eletrotécnica e de Computadores Supervisor: Rui Manuel Esteves Araújo, PhD

(2)
(3)

Resumo

A condução é um processo intrínseco e automatizado ao longo do tempo, especialmente para con-dutores mais experientes. Hábitos de condução errados e agressivos tornam-se comportamentos padronizados, e raramente são percebidos e corrigidos. Sendo as estradas um ambiente partilhado por milhões de condutores por todo o mundo, foram criadas regras de condução por autoridades relevantes, sendo que essas regras não corrigem diretamente comportamentos agressivos a não ser em casos extremos, e divergem de país para país. A segurança nas estradas é uma prioridade para todos, para que os condutores não se coloquem a eles ou outros em risco de acidentes. Este é o principal motivo que oferece relevância e propósito a este trabalho.

Assim torna-se essêncial reconhecer padrões de condução errados, a cada viagem, de forma a que o comportamento de cada condutor, a nível individual, possa ser melhorado. Antes de ser possível analisar e corrigir o comportamento de cada condutor é necessário analisar os padrões agressivos, e o que diferência um perfil de condução passivo de um agressivo.

Este trabalho foca-se na análise teórica das regras e padrões que definem um bom compor-tamento de condução, no desenvolvimento de uma aplicação móvel capaz de adquirir dados de condução e de realizar uma análise a esses dados em tempo real de forma a providenciar o condu-tor com informação sobre a sua condução, e da categorização de dados adquiridos em tempo real de condução. Assim, este trabalho pode ser interpretado como um conjunto de três passos para atingir um fim, o perfil de condução de um individuo.

Embora a condução seja um conceito universal, a sua análise não é simples, nem pode ser classificada usando apenas duas variáveis linguísticas, "boa" ou "má", foram utilizadas ao longo deste trabalho quatro variáveis para esse fim. O tipo de condução, podendo este caracterizar-se como "boa", "normal", "má" e "perigosa". Esta última é extremamente irresponsável e acarreta elevados riscos para o condutor e outros utilizadores da estrada. Cada variável linguística tem um conjunto de regras associadas que serão detalhadas neste trabalho.

Durante este trabalho três aspetos foram utilizados para o método de classificação. Os três se relacionam sendo que um é a derivada temporal do anterior. O "Jerk", variação da aceleração ao longo do tempo; a aceleração (lateral e longitudinal), e a velocidade instantânea. Embora apenas essas três variáveis sejam usadas, mais dados são adquiridos da condução e armazenados, como a velocidade rotacional, a aceleração gravítica e a intensidade do campo magnético. A posição, em coordenadas, é utilizada para identificação do local onde o condutor se encontra.

Vários condutores foram utilizados como fonte de aquisição de dados, cada condutor tem um mínimo de cinco viagens, de duração varável com uma duração mínima de trinta minutos, associadas. Dados de condução foram obtidos de vários locais distintos, urbanos, não urbanos e locais controlados de teste. Os condutores utilizados têm perfis de condução diferentes, uns mais passivos e outros mais agressivos, validado por entidades externas como familiares. Para garantir a autênticidade dos dados adquiridos as primeiras viagens de cada condutor não foram utilizadas no decorrer deste trabalho, deixando um período de habituação à utilização da aplicação.

(4)

O algoritmo de categorização dos dados foi uma parte essêncial deste trabalho, sendo que isso permitiu agrupar os dados à priori como mais agressivos ou mais passivos. O processo de categorização e processamento dos dados foi realizado recorrendo à utilização de lógica Booleana. Em resumo, a utilização de uma aplicação móvel para aquisição e processamento dos dados, em tempo real, permitiu aumentar a simplicidade de uso por parte dos condutores e a criação de um ambiente de fácil atualização e distribuição por vários utilizadores. A utilização de computação externa apenas foi utilizada para armazenamento de dados e estudo estatístico de uma grande quantidade de dados numa fase de validação do trabalho. A capacidade de computação móvel provou ser suficiente para aquisição, categorização, agrupamento, e processamento em tempo real dos dados.

Palarvras-Chave: Comportamento do condutor, análise comportamental, aprendizagem com-putacional, lógica Booleana, aplicação móvel.

(5)

Abstract

Driving a car is a complex process often intrinsic within drivers, especially those with many years of driving experience. Wrong driving behaviors often become patterns, that rarely get fixed or noticed. All around the world rule sets are created and used as a driving norm, since the roads are shared by millions of drivers with different personalities and traits. Road safety becomes a priority for everyone, so that a driver does not endanger himself or the other communal road users.

Therefore it becomes essential to recognize what characterizes as a "bad driving pattern", on a trip based analysis, so that a driver’ behavior can be improved upon at a personal level. Before performing an analysis on the behavior it’s essential to identify the patterns and the rules for what makes a driver "dangerous" or "safer". The question is not that simple, and it’s not enough to look upon the road safety guidelines of each country. Many times, the rules diverge from country to country and that proves to be an inefficient way to clarify and normalise driver’s behaviors.

This work focus on the theoretical analysis and the creation of the rule set and patterns that define a good driving behavior; the development of a mobile application for acquisition, storage and processing in real-time of driving data; and the processing and analysis of the driver’s storage data acquired via the previously mentioned mobile application. Therefore it can be perceived as a three stage process in order to achieve a ending, that ending being the profiling of drivers using non intrusive methods and a mobile platform for real time naturalistic data acquisition and storage. Although driving is a universal concept, it was perceived during the development of this work that driving cannot be defined using only two linguistic variables, therefore driving behavior was classified as more than "good" and "bad". Four linguistic variables were used instead. The "good", the "medium", the "bad" and the "dangerous" driving behaviors. Each of the linguistic variables as an associated rule set that characterises it.

For the course of this dissertation there were three main aspects that were used for the clas-sification method, the speed as which the vehicle is at each instant of the trip, the lateral and longitudinal acceleration and the jerk. Although those were the variables used for the classifica-tion purpose, more variables are acquired and stored by the mobile data acquisiclassifica-tion and processing application, those are the rotational speed on all three axes felt at the center of gravity of the ac-quisition platform, the gravitational acceleration, the magnetic field and the location in the form of coordinates.

As a data set, various drivers were chosen, each with at least five trips identified, and labeled with a minimum duration of thirty minutes per trip. Various locations, urban and non-urban set-tings were used for the data set, the provided data served to increase the robustness of the results. All drivers were verified to have distinct driving styles, with variations from more prone to ag-gressiveness and others more passive, and therefore, safer. It was essential to guarantee that the drivers didn’t adapt their driving style to the situation and therefore the initial data sets were not used for statistical purposes, that decision improved the overall quality of the processed data and robustness of the processing algorithm.

(6)

The labeling algorithm was an essential part of the data acquisition and processing, ensuring the correct label for the data made the processing simpler and more reliable, it allowed the data to be enveloped as groups, categorized. The data labeling and processing was implemented us-ing Boolean logic with lus-inguistic variables that aimed to cluster the data and a rule set that was improved upon over various iterations after analysis of the processed data and conversation with experts in road security and driving behavior.

In summary the use of a mobile application for real time data acquisition, labeling, and pro-cessing proved to be beneficial for the simplicity of setting up, the ease of use for the common user, and the ability to be up-gradable in the future with more features and a finer tuning. The use of external computational power was only needed for the overall analysis of the system, for analysing the bigger data set acquired over time and for plotting the relevant data. The use of external specific embedded systems proved not to be essential since the computational power of mobile devices proved to be powerful enough for acquisition, at a high sampling rate, and for the real time labeling and processing of the acquired data.

Keywords: driving behavior, behavioral measures, machine learning, Boolean logic, mobile processing.

(7)

Acknowledgments

First I would like to thank my supervisor, Professor Rui Esteves Araújo, for the continuous support and availability during my thesis development. I would also like to thank him for promoting the collaboration and knowledge exchange between students and for the help in finding works related to my dissertation that provided a crucial part for the success of this work.

To the Faculty of Engineering of the University of Porto for the knowledge and excellent conditions provided during all my degree and for the various teachers and supporting staff that helped me to reach to this work.

To Critical Software for allowing me to complete this work while on a full time employment, especially Paulo Leal for his continuous support and for the help and flexibility on scheduling my working hours and effort.

Last but not the least, I would like to thank to all my friends, especially Pedro for his contin-uous support and presence during this crucial stage of my life. And, a final remark, to my family, to my mum and sister, who always supported me, throughout my personal and academic life.

Joel Matos Vaz

(8)
(9)

“We are at the very beginning of time for the human race. It is not unreasonable that we grapple with problems. But there are tens of thousands of years in the future. Our responsibility is to do what we can, learn what we can, improve the solutions, and pass them on.”

Richard Phillips Feynman

(10)
(11)

Contents

1 Introduction 1

1.1 Context and Motivation . . . 1

1.2 Challenges and Goals . . . 2

1.3 Materials and Methods . . . 3

1.4 Thesis Outline . . . 5

2 Literature review 7 2.1 Introduction . . . 7

2.2 Driver Behaviour Profiling Using Smartphones . . . 7

2.3 In-vehicle data recorders for monitoring and feedback on drivers’ behaviour . . . 9

2.4 Detection and prediction of driver drowsiness using artificial neural network models 11 2.5 Driving Behaviour Style Study with a Hybrid Deep Learning Framework Based on GPS Data . . . 12

2.6 A System for Driver Analysis . . . 13

2.7 A data labeling method for clustering categorical data . . . 14

2.8 Modeling and Recognizing Driver Behavior Based on Driving Data . . . 16

2.9 How Much Data is Enough? A Statistical Approach with Case Study on Longitu-dinal Driving Behavior . . . 19

2.10 Conclusion . . . 22

3 Theoretical analysis, Boolean logic and data acquisition 25 3.1 Introduction . . . 25

3.2 Theoretical Analysis of Driving Profile . . . 26

3.2.1 Country Guidelines . . . 26

3.2.2 Experience Guidelines . . . 30

3.3 Boolean Logic Algorithm . . . 32

3.3.1 Linguistic Variables . . . 33

3.3.2 Rules and Tuning . . . 34

3.4 Data Acquisition Logic . . . 35

3.4.1 Labeling . . . 38

3.4.2 Naturalistic Data Plots and statistical analysis . . . 41

3.5 Conclusion . . . 43

4 Mobile application platform and system validation 47 4.1 Introduction . . . 47

4.2 Agile Methodology . . . 48

4.2.1 Benefits of using Agile for Software development . . . 50

4.2.2 Kanban board used for user stories and tasks . . . 52 ix

(12)

4.3 Mobile Application . . . 53

4.3.1 Android and code portability . . . 54

4.3.2 Coding Guidelines . . . 55

4.3.3 The Programming Language Java/Kotlin and the User Interface Design . 58 4.3.4 Software Architecture . . . 62

4.3.5 Data Acquisition Implementation . . . 65

4.3.6 Data Storage: Firebase . . . 66

4.3.7 Trip data Processing in Real Time . . . 68

4.3.8 Trip Review results . . . 69

4.4 Verification and Validation . . . 71

4.4.1 Verification: Unit Testing . . . 72

4.4.2 Verification: Black Box Testing . . . 73

4.4.3 Validation: Comparing Predictable Results . . . 74

4.4.4 Validation: Real Life Scenario with Driving Instructor . . . 75

4.5 Conclusion . . . 76

5 Conclusions and future work 79 5.1 Achieved Purposes . . . 79

5.2 Future Works . . . 80

References 83 A Source Code 89 A.1 Kotlin Main Activity . . . 89

A.2 Kotlin Trip Review . . . 100

A.3 Kotlin Labeling . . . 105

A.4 Android Manifest File . . . 109

A.5 Python Plotting Script . . . 111

B Android Application User Interface 115 B.1 Main Activity View XML . . . 115

B.2 Main Activity View PNG . . . 121

B.3 Trip Review View XML . . . 121

B.4 Main Activity View PNG . . . 126

C Full Naturalistic Raw Data Set 127 C.1 Diver Id=12345, Trip 4, Sample, Joel Vaz . . . 127

(13)

List of Figures

1.1 Overview of the system . . . 5

2.1 Smartphone concept model for obtaining the driving behavioural profile [1] . . . 8

2.2 IVDR proposed system architecture. . . 9

2.3 Example of trip based driver report [2] . . . 10

2.4 Figure of a Artificial Neural Network structure . . . 11

2.5 Autoencoder-Self Organizing Mapping overall architecture . . . 12

2.6 System architecture used for the aforementioned work [3] . . . 14

2.7 Data labeling algorithm rough membership function-based similarity . . . 15

2.8 Visualisation of data clustering on the right as opposed to naturalistic unclustered data on the left . . . 16

2.9 The diagram representing driver-vehicle steering control system: driver’s steering control law [4] . . . 17

2.10 The flow diagram of driver model identification. [4] . . . 18

2.11 Major projects of naturalistic driving study in the world, * was used to represent uncertainty to the amount of data; note that some of the references are not in this work . . . 20

2.12 Example of in-vehicle data acquisition systems developed by University of Michi-gan [5]. . . 21

2.13 Illustration of data acquisition systems for car-following behaviors using a cam-era/video recorder with a fixed position. . . 22

3.1 Driving Behaviors Reported For Drivers And Motorcycle Operators Involved In Fatal Crashes, 2017 . . . 26

3.2 Number of road accidents by type in Portugal, Source: ANSR . . . 27

3.3 Speed values for the different road types and vehicles for Portugal . . . 27

3.4 Speed values for the different road types and vehicles for the United Kingdom . . 28

3.5 Acceleration and speed profile for a trip, axis X represents the time in seconds and axis Y the acceleration module in m.s2on the left, and the speed in m/s on the right. 31 3.6 Plotting of the speed over time curve, this represents the plot of a full acceleration movement and not used for the driving profile analysis. . . 32

3.7 Boolean algorithm implemented for the labeling process view in the macro system algorithm. . . 33

3.8 Data set of a driver considered aggressive, location was urban and the trip duration was 650 seconds, around 11 minutes. . . 36

3.9 List of sensors across a mobile device. Source Internet . . . 37

3.10 Algorithm used for calibration and redundancy of the sensor responsible for ac-quiring the acceleration. . . 38

(14)

3.11 Acceleration profile of a trip with duration of 4000 seconds. Axis X represents the

time stamp in seconds, axis Y represents the acceleration in m.s2. . . 39

3.12 Speed profile for the corresponding acceleration on figure 3.15. Axis X represents the time stamp in seconds, axis Y represents the speed in m/s. . . 39

3.13 Algorithm used for the labeling of the raw data points. . . 40

3.14 Clustered data point of a Json file, acquired in a naturalistic form. Note that this points are part of a larger data set present in the appendix 3 of this document. . . 41

3.15 Acceleration profile of a trip with duration of 560 seconds. Axis X represents the time stamp in seconds, axis Y represents the acceleration in m.s2. . . 42

3.16 Speed profile for the corresponding acceleration on figure 3.15. Axis X represents the time stamp in seconds, axis Y represents the speed in m/s. . . 43

3.17 Voting system that improves data reliability by accepting only the value that at least two of the three sensorization data sets agree upon. . . 44

4.1 Kanban board prototype used for the project . . . 50

4.2 Macro view of the system composed of micro functionalities. . . 51

4.3 Branching strategy employed for the work. . . 52

4.4 Kanban board at a point of time. . . 52

4.5 Icon of Android, the operative system chosen for the development. . . 53

4.6 Icon of Docker, the image container platform used for development across differ-ent operative systems. . . 54

4.7 Android Studio development environment used for this dissertation. . . 55

4.8 File Directory Structure. . . 56

4.9 File Header for MainActivity. . . 57

4.10 Kotlin programming language. . . 58

4.11 Design pattern used for organizing information. . . 60

4.12 Design pattern used getting input from user. . . 61

4.13 Application presented main view. . . 61

4.14 Application Logo. . . 62

4.15 System level architecture of the application. . . 63

4.16 Development testing environment using a specific screen size 720p to visualise the UX and simulate software behavior. . . 64

4.17 Print from the online data base where the driver Id logic is implemented. . . 65

4.18 Print from the mobile device while running the application, data acquisition and labeling is in progress. From Driver with Id 15. . . 66

4.19 Firebase logo. . . 66

4.20 Data point from firebase using Json structure. Notice the corresponding Hash key on the first line. . . 67

4.21 Snippet from the Android application source code where the android and the database communicate. . . 67

4.22 GPS limitation to Porto, in blue the areas considered Urban and in Red the Invalid areas. . . 68

4.23 GPS limitation to London, in blue the areas considered Urban and in Red the Invalid areas. . . 69

4.24 Print from the trip review window where the driver gets the feedback from the behavior analysis performed by the application with the acquire data. In this case the driver got the ideal behavioral analysis. . . 71

4.25 Unit tests are the first layer of the verification procedure, and ensure that each function or method work as intended. . . 72

(15)

LIST OF FIGURES xiii

4.26 Unit Test for Kotlin function that converts meters to kilometers. . . 73

4.27 Visualization of the black box testing procedure. . . 74

B.1 Main view generated from the XML file above. . . 121

(16)
(17)

List of Tables

3.1 Acceleration profile for a normal, "non-aggressive" driver . . . 29 3.2 Acceleration profile for an aggressive driver . . . 29 3.3 Driving style categorization according to speed and acceleration limits, legal limit

is the one specific for the country, road type and conditions. . . 30 3.4 Linguistic variables used on the scope of this dissertation. . . 34 3.5 Rule set employed for the input raw data. . . 34 3.6 Possible Labels for data clustering with description and an example data set. . . . 40 4.1 File naming guideline . . . 56 4.2 Java features compared to kotlin. . . 59 4.3 Percentage of active devices for the most popular android operative system

ver-sions, source [6]. . . 64 4.4 Qualitative trip feedback and estimation of cases. . . 69 4.5 Validation input Data used for testing procedure, each of the input data sets was

repeated 10 times during the trip, the other overall behavior was "ideal" withing the legal limits. . . 75

(18)
(19)

Symbols & Abbreviations

AESOM Autoencoder-Self Organizing Mapping AI Artificial Intelligence

ANN Artificial Neural Network

ANSR Autoridade Nacional de Segurança Rodoviária API Application Programming Interface

BN Bayesian Networks CAD Computer-Aided Design CAN Controller Area Network

GIT Distributed version-control system for tracking changes in source code GPS Global Positioning System

HMM Hidden Markov Model

Hz Hertz

Id Identifier

IVDR In-Vehicle Data Recorder JSON JavaScript Object Notation ML Machine Learning

MVP Minimum viable product NDD Naturalistic Driving Data

NHTSA National Highway Traffic Safety Administration OBD On-board Diagnostics

OS Operative System

RAMS Reliability, Availability, Maintainability & Safety SOM Self Organizing Mapping

SVM Support Vector Machine SWM Steering Wheel Movement UI User Interface

UK United Kingdom

UML Unified Modeling Language UX User Experience

WIP Work in progress

(20)
(21)

Chapter 1

Introduction

The scope of this work is to demonstrate that it’s possible to create a mobile platform for data acquisition, categorization and processing of driving information in real time with a high level of fidelity, and the development of the demonstrated application. The acquired data is used for the creation of a driver’s behavioral profile and, therefore it can be used as a means to improve overall road safety on a personal basis. This work has a big emphasis on the state of the art software development methodologies and patterns used during the development of the mobile application. Specifically the agile methodology for time management and resource allocation, the software coding guidelines followed during development, the design patterns used for the user interface design, and the importance of verification and validation methodologies used for the testing of the software created and the overall system architecture.

Important to mention that this dissertation can serve as a foundation for future works on driver’ behavioral analysis, and also on the categorization of naturalistic driving data.

1.1

Context and Motivation

Driving a car on a shared environment is a complex system for our brain to process. It’s a system with a large amount of variables, all of them being processed in real time and that requires instant decisions from the driver. Therefore, the driver physiological and psychological status take a huge role in this complex system [7]. Over time, drivers acquire experience and develop patterns that reflect in a driving style. Those patterns are usually based on the driver personality trait and tendencies to be more prone to aggressive or passive behavior. The analysis and interpretation of those patterns that reflect in the driving style becomes an essential aspect of overall road safety [8]. This analysis aim to provide the driver with more information on some aspects that might not be easy to interpret in a real time scenario. In the long term it can help the drivers to improve over dangerous behaviors, and make the roads safer.

As it is known, the roads are a shared environment, where on a daily basis, millions of drivers, with their own personal driving styles, commute. Sometimes those driving styles prove to be dangerous, and many preventable road accidents, some resulting in injuries and even death, occur.

(22)

The main purpose of this dissertation is to act at a personal level to improve on those behaviors. Firstly, by understanding the driving style of a person and how to recognize it. Secondly, by providing a mobile platform for that purpose that all the drivers can use. The first point entails a theoretical analysis of the behaviors that partake on the driving aspect. For the second part, the acquisition of various data sets from different drivers over many trips, the processing of the acquired data using the previously defined linguistic variables and rule sets, and the verification and validation of the work using experienced driving authorities and outside neutral observers. The previously mentioned objectives are the main scope of this work and presented during the following chapters.

Although drivers are aware of the adverse effects that driving under intoxication effects, such as alcohol or drugs, or under the effect of sleep deprivation, take on the act of driving. Not many are aware of the effects that an aggressive driving style can have for road safety. Currently and according to various studies on the field of road safety, over-speed and aggressive behaviors are the main cause of injuries on the roads, and therefore, the importance of this work.

From the act of driving, three main data sets can be acquired and processed in real time, to infer on a driver’ behavior. These three data sets are directly related, each being the integral result of the other over time. The jerk associated with the variation of the vehicle acceleration over time, the acceleration, both lateral and longitudinal, and the instant speed that the vehicle is moving at a given time. Those three data sets acquired over time and with the vehicle positioning in coordinates can be analysed for patterns that define a driver’ road behavior.

As a side note, it’s also important to take onto account that the vehicle industry is shifting onto the autonomous vehicles. Self-driven cars, controlled by a computing platform, are starting appear on the roads and can eventually replace the human side of driving. This work can still prove to be relevant in that section of the industry. By providing the tools for profiling and acquiring self-driving vehicle data, and by categorizing the acquired data from various different vehicles at the same time. That data can then be used to improve the overall design of the computing units that control the autonomous vehicle.

1.2

Challenges and Goals

Often, the driver’ behavior on the road is a set of habits acquired over time and their road expe-rience. Like all acquired behaviours it’s not easy to change or improve upon [9]. Studying what characterizes a driving style as aggressive is therefore essential in order to act upon the behavior. Although it might seem obvious for outside observers many times the person behind the wheel does not realize that he’s driving in an aggressive manner and increasing the risk of harm to him-self and others. The first step for changing a behavior is understanding that behavior and that’s the main driven factor for this work.

Multiple researches and papers have already been done in this field, and there are some devices that can be installed on a vehicle to monitor speed and acceleration in real time. Although those

(23)

Introduction 3

devices provide a good feedback as a data acquisition platform, they prove to be many times expensive. Usually employed as a monitoring devices for fleet management or insurance related purposes. Various works aimed to prove that a driving behavior can be predicted using the car OBD (on-board diagnostics) port for data acquisition, but that method proved to be expensive and, therefore used for fleet management purposes also. An interesting work using a mobile device for data acquisition was used as reference for this work and improved upon, since it provided the basis of this work and is mentioned in more detail in chapter 2. This work aims to be an improvement of the previous.

Some challenges were found along the way, the theoretical analysis of driving behavior re-quired an intense research work. With the need to be as accurate as possible in order for this work to have any validity and relevance. The acquired data needed to be labeled and clustered in order to be used and processed in a mobile platform. That data was acquired using different drivers over diverse trips with different duration and, the organization and clustering of all the data proved to be a challenging step in order to achieve the scope of this work. Also there was an increased effort in finding volunteers for this work, and guarantee that those volunteers provided accurate and naturalistic driving data. In the end, the processing and statistical analysis of the work proved to be the easiest step, with all the data sets enveloped in labels and categorized in clusters, the rule set created and the linguistic variables and rules tuned, processing the data was a smaller step. The statistical analysis of all the acquired data, was out of scope of this work, but aimed to validate the initial premise that many drivers are not aware they are aggressive on the road, and that they can improve their behavior.

Also it was of a greater importance the relevance given to the software development method-ologies and time management tools used during this work. Those are also described in detail here, and although they do not directly provide any output for the system, they took a big role in the development process. Guaranteeing that in the end the results were the ones expected and that was validated.

Considering the motivation behind this work, presented above, the mentioned works of other individuals that aimed to achieve the same results, even if the purpose was different, and the challenges found along the way this work became a full dissertation project and onto fruition. The main purpose was to prove that it can be done, and provide an initial product in the form of a mobile platform for real-time driving data acquisition for profiling a driver’s behavior. If employed at a personal level by a large amount of the population, the end goal of this work is to improve overall road safety by correcting and helping to change driving aggressive behavior.

1.3

Materials and Methods

In summary the developed work aims to provide the platform for profiling driving behavior through the following aspects:

• Theoretical Analysis — Performing a detailed literature analysis and interviewing experts in road safety and psychological behavior was the starting point for this work. The analysis

(24)

of the state of the art in driving monitoring devices (both in commercial and non-commercial applications) and state of the art in data acquisition and processing allowed a set of rules to be developed during this work for profiling driving behavior.

• Data Acquisition — The acquisition of data was an essential step, using a high sampling rate allowed for more robustness but at the same time it pushed the mobile platform and online data base limits, a trade off was made and described in detail in chapter 3. The acquired data was not stored only in a raw form but also enveloped in labels using a labeling algorithm studied during the theoretical analysis of this work and presented further in detail. Dozens of different drivers volunteered for this work and provided data over many trips in different locations and different behaviors. A small group of drivers in a limited and controlled environment was used as a control group to help validate the work, they allowed the acquisition of more aggressive driving data that would be impossible to acquire in a shared road environment, due to safety issues.

• Data Processing — Processing all the acquired data in real time in a limited resource mobile application was possible to the the previous labeling off all the data sets, the data is processed in a trip by trip basis, each trip associated with a driver. The processing algorithm uses Boolean logic, applying the rule set studied during the theoretical analysis of this work. The final result is a easy to understand linguistic output that reviews the driver’ trip and is transmitted to the driver in order for him to improve the behavior during the next trips. • Mobile Application — A mobile application was created in Android, easy to integrate with

Apple’ mobile operative system in a future work. The mobile application is responsible for all the data acquisition and trip processing and uses a simplistic user experience experience. That allows for every driver to set up the environment and review the trip analysis in a quick manner and without a steep learning curve. The mobile application was developed using specific design patterns, presented in detail on the scope of this work, and the agile methodology.

• Verification and Validation — The validation was a crucial part of this work, it was per-formed using driving instructors experience, relevant authorities in road safety, a control group for the data acquisition and a statistical analysis of the results. The statistical analysis provided basis for the relevance of this work and served as a validation for the driver’ pro-file. Besides the formal validation, all the software created was tested using unit testing and black box testing, which aimed to improve the robustness of the work.

Figure 1.1depicts the overall system architecture and the main sub-systems that compose this dissertation. It also gives insights on some of the methodologies used for the system management or the resource management. It represents a top-down view in a very simplistic form and is detailed further down this paper. The scope of this project is to create a mobile application, capable of acquiring naturalistic driving data sets, storing the data in clusters on an server-less data base, and

(25)

Introduction 5

Figure 1.1: Overview of the system

provide a immediate feedback based on the trip review to the driver. This dissertation also allows further works such as profiling the driver using the entire stored data sets.

The aforementioned topics are the foundation and the set of goals achieved during this disser-tation, it might seem like and extensive work but they all interlace in a symbiotic way, and although they can each be studied as an independent system the outputs of each previous item serve as an input for the others. The validation stage aimed at closing the loop and prove that the theoretical analysis was performed in a correct manner, and also that the developed application behaves as expected.

1.4

Thesis Outline

The current chapter serves as an introduction and summary of the performed work, where the goals and motivations are presented. This dissertation is divided in five chapters, being the current chapter the first.

Second chapter of this work details the state of the art and the bibliographic works that served as a foundation for this project. A detailed revision over various articles and works was performed, and although a few works are mentioned in the next chapter they are only a small sampling of all the works used as reference, since providing the full list and reviewing would be too extensive.

(26)

In chapter three it is presented the theoretical analyses performed and the rules created for this work. The Boolean logical algorithm is described in detail in this chapter also, as well as the scoring variables used and the associated rule set. The data acquisition logic, clustering, sampling rate and data labeling is also in the scope of this chapter. The analysis of the labeling algorithm and storage mechanism for the data is described in detail and some of the data sets are demonstrated and studied.

The chapter four details the processing of the acquired data and the statistical analysis and validation performed during this dissertation. It provides the implementation logic of the machine learning algorithm used for the scope of this work and the linguistic variables and rule set appli-cation. The acquired data and results are also presented in this chapter. The last part of chapter four describes the validation and verification procedures and the fine tuning process of the pro-cessing algorithm. Software development methodologies and design patterns used are also part of the scope of this chapter.

Lastly, chapter five, presents the conclusions of this extensive work, and some possible future works and areas where this project can be improved upon are discussed. It states the achieved goals and the final remarks.

(27)

Chapter 2

Literature review

2.1

Introduction

This chapter corresponds to the state of the art analysis that served as a foundation for the devel-oped work. Some of the articles and works presented on this chapter are of a more theoretical nature, as they focus on the theoretical analysis of driving style patterns and present algorithms for analysing and obtaining a driver’ behavioral patterns. While, on the other end, the other articles relate to a pure data analysis and the algorithms for labeling, obtaining and parsing the relevant information from a big pool of data, and the clustering of naturalistic driving data sets.

All the works presented in this section were approved by a jury and some of them are from renown researchers in the area of driving behavioral analyses and from the data processing field.

2.2

Driver Behaviour Profiling Using Smartphones

This paper [1] purposes using the capability of the smartphone sensors to provide an accurate driver behavior prediction. The advantages of removing the "black box", data acquisition platform from the vehicle are many. Communication costs are cut to zero for the monitoring company, the cost of installing hardware is cut from the process and the ability to provide the driver information in real-time is a positive aspect of using a smartphone. The main negative aspects are a decrease in data sensorization precision due to the limitations of the smartphone as a data acquistion platform, and a noisier data set that can be corrupted if the user takes actions on the smartphone while driving, for example, taking a phone call or browsing the web.

The main sensors used on the smartphone (as a form of input data) are the accelerometer, magnetometer, gravity sensor, and the GPS receiver. In order, they provide information about acceleration, vehicle orientation (i.e., degrees of steering), speed information and location. Since the data acquisition works at different sampling rates, some data is more precise than other, for example, accelerometer works at 5Hz while GPS receiver works at 1Hz, therefore the first has a more precise indication. All the input data was validated and corrected, for example, acceleration errors due to vibrations of the smartphone were minimized.

(28)

Figure 2.1: Smartphone concept model for obtaining the driving behavioural profile [1]

The information provided by the input sensors was then inserted in a fuzzy system, using specific membership functions and three linguistic labels, Low, Medium and High. A set of 18 rules composed of IF-ELSE statements were created in order for the profiling algorithm to work. The defuzzification process then gives a result between 0 and 100, 0 being the best possible score and 100 being the worst possible score. In this article, the problem is then transformed into a Fuzzy Inference Problem, for each particular environment, i.e., urban, suburban and extra-urban. The final score is then computed taking into account different weights for the different environments, urban having a heavier weight than the other two.

Due to the imprecision of the smartphone’s sensors and the fact that the data was not validated and the amount of noise reduced or at least attenuated this article does not solve the proposed main problem proposed by this dissertation. Since the driving profile is not accurate enough. Nevertheless, the fuzzy approach for profiling drivers seems very interesting and accurate with precise data as input. The presented work was used as a foundation for the developed work, but a redesign of the entire data acquisition architecture was essential, as well as a rethinking of the mobile application used for acquisition and data processing.

• This article provided important feedback on the possibility of using a mobile platform as a data acquisition platform.

• Also provided a baseline for the processing algorithm, by transforming the problem into a fuzzy system.

• Provided feedback on the importance of using accurate sensor redundancy for the input data acquisition and the importance of sensor calibration during system set up.

• Lastly it provided feedback on the importance of clearing the acquired data from unintended and unexpected input noise.

(29)

Literature review 9

2.3

In-vehicle data recorders for monitoring and feedback on drivers’

behaviour

This study follows a trip centric approach [2], where each trip is analysed with an IVDR (In-Vehicle Data Recorder). The main idea is to provide the driver with feedback on his driving behavior for a specific trip. It does that by analysing various aspects of the driving, such as high risk manoeuvres and quick deceleration and accelerations.

The main inputs of the system are:

• The driver identifications number, unique across all the users; • Trip start and end time, important for controlling the acquired data;

• Accelerometer data, provided by an accelerometer sensor within the data acquisition telem-atic;

• Vehicle speed provided by the GPS position over time, provided by a GPS receiver module within the telematic box;

• Vehicle location, also provided by the GPS receiver;

• Engine parameters that can be acquired from the vehicle on-board diagnostics system, such as engine provided torque at each given instant.

The overall system architecture for this work can be seen in figure 2.2. The measurement section relates to the device installed on the vehicle and the direct feedback it receives from the sensors.

(30)

To filter the big amounts of data acquired a specific algorithm was implemented, that detects patterns, such as a risky manoeuvre e.g., lane changes followed by a quick deceleration. Each detected scenario is therefore computed in a mathematical formula that will give the overall rating for that trip riskiness. The feedback is therefore provided to the user, for example, in a website. The next figure 2.3shows and example of the feedback provided for a given trip.

Figure 2.3: Example of trip based driver report [2]

Over a long period of time, the amount of trips and obtained reports can be used to create a database and, therefore, profile driver’ overall behavior. This article gave a feasible proposal for the problem of this dissertation. However, this approach is very hardware centric, requiring a connection to the car on-board diagnostics (OBD) and that proved to be an intrusive and expensive way to obtain data. For that reason, this approach seemed to be impractical. The main aspects were acquired from this work, and some of them used on the scope of this dissertation.

• The ability to identify different drivers by using unique identification numbers.

• The ability to acquire and process data on a trip by trip basis, therefore providing faster feedback to the driver in real-time after each trip.

• The possibility of providing a statistical analysis of the driver history, i.e., all the trips that the driver had over a given time.

• A possibility of using linguistic qualitative feedback to the driver in relation to the safety level of the given trip as an output of the system.

(31)

Literature review 11

2.4

Detection and prediction of driver drowsiness using artificial

neu-ral network models

This approach [10] is used to predict drowsiness on the driver, but can also be used to obtain data related to driver’ behavior. ANN (Artificial Neural Network) [11] is a nonlinear modelling machine learning technique that works especially well with noisier data, and many times, data for profiling a driver’ behavior is very prone to noise, that makes the ANN a robust approach. Sensoring data obtained especially from a mobile device can be, at times, corrupted with non intended noise. The vibrations of the vehicle can provide disturbance on the data acquisition platform and invalidate the results of the system. A ANN can be used to attenuate that effect and guarantee the reliability of the system output. During this article this approach was detailed and performed, with positive results.

The ANN in this work was created using the Matlab’ neural network toolbox [12]. It follows the typical structure found in the figure 2.4. The training method is the Levenberg-Marquardt algorithm [13]. The input data used for driving performance and behavior is:

• The Lateral distance relative to the mid-lane, relates to the position of the vehicle on the road.

• The time-to-line-crossing, in relation to the overtaking duration of the vehicle in relation to other vehicles.

• Steering wheel angle.

• Vehicle acceleration, both longitudinal and lateral acceleration were used. • The Speed and number of crossings.

(32)

This article is not related directly to the driver’ behavior analysis, but gives a good approach for analysing a big noisy data set, typical of driving profiling problems. For that reason it was considered for this report. Depending on the amount of data ANN performance can prove to be more beneficial than a deep learning algorithm, especially for lesser amounts of data, both methods offer good noise filtering and an accurate prediction of a drivers’ behaviour profile. Important to mention that in the end, the ANN architecture was not implemented due to the limitation amounts of acquired data. An ANN architecture needs a big clustered data set to be reliable, and in the scope of this work that was not a possibility.

2.5

Driving Behaviour Style Study with a Hybrid Deep Learning

Framework Based on GPS Data

In this article [14] the author takes a deep learning framework approach, with a big heterogeneous data set provided by various GPS units installed in different vehicles. The deep learning approach follows and unsupervised learning and classification architecture (i.e., AESOM (Autoencoder-Self Organizing Mapping), as seen in figure 2.5). Using the mathematical principles of the distributions found in the classical statistical analysis [15].

(33)

Literature review 13

The classification process as been deeply studied in many articles, and the relations between aggressiveness behavior patterns and the nature of driving styles [16]. The learning is done in an unsupervised environment and does not rely on a-prior definition. That makes the system more adaptable to different data sets, providing minimal losses in the lower dimensional code (i.e., the driver’ behavior profile that outcomes from the framework). In general, the input data that follows patters such as big accelerations, speeding profiles, instant big deceleration and improper vehicle positions, are indicators of an aggressive driving profile.

SOM (i.e., Self Organizing Mapping) learns on its own through unsupervised competitive learning, where each neuron compete for an activation opportunity. only one neuron is activated at once by the input stimuli at any instant of time t. The main advantage of SOM for the classification is that it provides a certain level of immunity to noise from the input data, and it also outperforms classical clustering techniques, such as K-means method [17]. SOM requires no inspection and assigns itself based on the weight given to the input nodes.

From this article the conclusions obtained were:

• Compared to other state-of-the-art modelling and analysis techniques AESOM proved to be more effective against noise propagation from the GPS and mobile sensors data sets; • Driving behavior features learned by AESOM were easily interpreted;

Therefore, using a Deep Leaning Framework approach, especially AESOM, seems to be a good possibility for the problem of this dissertation, but it seems to be a harder approach (both in terms of resources and learning time). Requiring a massive input data set and computational power. Due to the last mentioned difficulty, this deep learning technique was not used for the processing of the data set. Limitation on the amounts of acquired data invalidated this approach, nevertheless this approach seems very promising and can be implemented in possible future iterations of this work.

2.6

A System for Driver Analysis

In this paper [3], the main idea is to produce a driver’ profile without the use of a black-box (i.e., an external telematic tool). For that purpose, a smartphone application was developed and imple-mented. It uses the input data from GPS position, accelerometer, gravimeter and magnetometer to access the driver’s profile. The data is processed using an event detector, a type of algorithm that will detect patterns found on the data set (e.g., a line change). Those events are sampled in a fuzzy algorithm that will output a driver classification based on a specified and tuned rule set.

Since the system is implemented in a smartphone the sampling rate for the input data was chosen following a trade-off between precision and battery consumption, with the exception of the GPS receiver that has a constant sampling rate of 1Hz. The magnetometer allows the system to obtain a precise orientation of the vehicle in relation to the mobile device.

(34)

Figure 2.6: System architecture used for the aforementioned work [3]

The event detector algorithm [18] detects U-turns, curves, turns and lane changes. The fuzzy method that processed the events based on the linguistic variables and respective membership functions classifies the driver in a scale of 0 to 100 on his level of aggressiveness.

This paper provides a simpler, yet efficient, solution for the problem, but noise filtering and correction of the smartphone movement inside the vehicle were not taken into account, and there-fore the driver profile acquired is only an estimation and not very precise model. The results of this work were observed not to be ideal, but proved to be prone to optimization by the use of a better calibration and data validation mechanism on the mobile device.

2.7

A data labeling method for clustering categorical data

This article focus on data labeling, that is an essential method for processing a big data clustering of raw data sets. Raw data can be extremely confusing and difficult to work with, especially in the area of machine learning and data analysis. As the world progresses so does the amount of data obtained from systems, some times the amount of data can get overwhelming and impossible to work with, or to obtain any relevant information. To scale down the amount of data and therefore acquire a workable data set, usually researchers use sampling, that is, obtain a "small" sample from the big data set. Although sampling helps in managing the amount of data for processing and, therefore, cut down the processing time. That method alone proves to be hard to use, since the sample data can be difficult, or even, impossible to group onto data clusters, that is, when a research looks at the sampled data it’s difficult to understand what you are looking at. Grouping the data according to predefined patterns, therefore, becomes an essential task of any data analysis and processing work.

Due to the above problem this work presents a way to label and, as a result, allow the sampled data to be clustered by the use of a simple, yet efficient algorithm of labeling. Clustering is the act of allocating every data object onto an appropriate cluster [19]. A cluster is a group of information that is similar in some selected proprieties, and has a shared pattern. A cluster of data can be seen as a set of data that is enveloped and similar in some predetermined form.

(35)

Literature review 15

In the next image 2.7, a table acquired from the article describes the used algorithm in de-tail for labeling a cluster of data obtained from a big data set. It uses the rough membership function-based similarity algorithm as a labeling mechanism. That algorithm aims to allocate each unclustered data object into the corresponding cluster. Each unclustered data set is labeled according to the maximum similarity between a preciously defined cluster, i.e., an unclustered data set with properties that approximate an already well defined and constrained data cluster will be labeled as a member of that cluster.

Figure 2.7: Data labeling algorithm rough membership function-based similarity

The work presented on this paper goes further in detail by analysing the algorithm performance in a real-life scenario against other known algorithm clustering algorithms. Such as the k-modes algorithm for data clustering [20]. This work contributed majorly for the scope of this dissertation by:

• Providing feedback on the importance of data clustering and grouping 2.8.

• Provide a tool for data clustering and labeling algorithm.

• Lastly, it provided metrics on the data labeling and clustering algorithm performance.

• It helped improve system overall processing performance by taking advantage of the clus-tered predetermined data during the processing logic.

(36)

Figure 2.8: Visualisation of data clustering on the right as opposed to naturalistic unclustered data on the left

2.8

Modeling and Recognizing Driver Behavior Based on Driving

Data

In this survey a mathematical model was created to represent and modulate driving behavior using driving data, such as brake/throttle pedal position and the steering wheel angle. According to the paper, driving skill/state can be classified into four steps [4].

• Modeling Driver Behavior — The model structure can be established and parameters of the driver model can be identified based on human driving behavior, which might be classified roughly into three cases: parameter identification, non parameter identification, and semi parameter identification.

• Recognizing the Characteristics of Driver Behavior — After driver model has been de-termined, the driver behavior or driver’s driving skill should be characterized. Here, many driving tasks or situations (such as car following, lane change, collision avoidance, etc.) can be described with numerous mathematical methods.

• Evaluating and Verifying Based on the Driver Model — The objectives of identification followed by the modeling of driver behavior are meant to improve the performance of vehi-cle dynamics and to design more intelligent driver systems. Therefore, the efficiency of the driver model needs to be evaluated and verified, especially in the field of handling quality and driver assistance systems.

• Embedding Driver Characteristics into the Advanced Vehicle Systems — Producing more intelligent vehicle-driver systems is always the engineer’s ultimate goal during the de-sign process. Consequently, driver assistance systems that can timely and accurately detect

(37)

Literature review 17

and predict the driver’s attention and seamlessly integrate with the driver’s characteristics are crucial.

The goal of a driver’s model, obtained by simplifying driving behavior using logic and math-ematical equations, is to accurately describe, imitate and predict driving behavior in longitudinal (e.g. speed) and lateral movement (e.g. steering angle).

As it is known, modeling driving behavior is a difficult task, due to non linearity of most of the driving aspects and the uncertainty of aspects such as those presented in the following list [21].

• Permissibility or Admissibility — It can also be called the complacency component of driver behavior [22] and [23]. One example is the driver keeping his steering command constant when the required change in steering angle is small.

• Physical Limitations — Most information collected depends on the vision, vestibule, tac-tile, and auditory perceptions of the driver. However, by reason of human limitations, the driver might be insensitive to some subtle changes. For instance, the driver may be unable to perceive changes in speed when the linear acceleration of the vehicle is lower than 0.005 g.

• Transport Time Delay — There is a possibility of response time being different between individuals; for example, aged drivers might spend more time to brake or steer the wheel than younger drivers.

The above list was presented in the paper as the main non-linear and unpredictable aspects in modeling driving behavior and they were "approximated" using mathematical linear expressions.

Figure 2.9: The diagram representing driver-vehicle steering control system: driver’s steering control law [4]

(38)

From the driver’s steering control law, as can be visualised in figure 2.9, and after obtaining the mathematical model, simplifying the non-linear and unpredictable driving aspects, the following flow chart 2.10was presented as a algorithm for identifying a driving model. Important to mention that the main scope of this paper was to present and compare the different mathematical models currently in use for modeling the driving process. This was not the scope of the dissertation where this article was analysed but, nevertheless, valuable insight was obtained from this survey in relation to how to predict and understand driving behavior.

(39)

Literature review 19

The above survey proved insights on various algorithms for identifying driving skill and mod-eling driving behavior and therefore was a crucial reference for the work implemented during this dissertation. The main aspects taken from this work was the non-linearity modeling difficulty of driving behavior, the need for simplification of non predictable behaviors, such as the driver reaction time, and the importance of understanding driving as a complex system with multiple variables.

2.9

How Much Data is Enough? A Statistical Approach with Case

Study on Longitudinal Driving Behavior

The big data age we are now on served as a foundation for this paper, the big data provided a powerful ability to model and understand driving behavior [5]. This paper focus more on limiting the amount of data needed and aims to prove, that too much data can be counter productive and waste resources while not benefiting the modeling system.

Naturalistic driving studies, fundamentally those that use data obtained from real life scenario proved to be essential in modeling driving behavior [24], where data was obtained by drivers in a naturalistic environment in a non intrusive method [25]. The following table 2.11, obtained from the article [5] shows the effort that various institutions made to obtain naturalistic driving data. It aims to prove how reliable, and used across various driving modeling works across the world, naturalistic driving data is.

The question of how much data is enough was already studied in other fields such as, in sociology [26] and biology [27], to cite a few. Therefore it proved important to demonstrate and prove how much data is enough to model driving behavior and perform an analysis of a driving behavioral profile.

This paper focused more on the car-following behaviors, as those are the most used in terms of analysing driving behavior due to the linearity they provide. The driving data used varies from under 50 minutes, in works such as [28] and [29] and up to 5000 minutes in works such as [30]. The main factor in determining the amount of data used on the study is the problem formulation methods used, i.e. Modeling and analyzing drivers’ car-following behaviors, generally involves either a physically-based or a learning-based method and the amount of needed data varies according to the method chosen.

• Physically-based methods — Physically-based method usually describes driver behavior in the form of equations with physical meanings, in which parameters are used to fit the individual driver’s characteristics via parameter estimation or calibration methods [31] and [32]. Most popular car-following models were compared and evaluated in [33] and [34]. Thus, the requisite amount of data depends on a number of unknown parameters in physical models. Generally speaking, a physical model with many unknown parameters requires more driving data to fit driver behaviors. In addition, the amount of required data also depends on the method used to calibrate car-following models. For example, a calibration

(40)

Figure 2.11: Major projects of naturalistic driving study in the world, * was used to represent uncertainty to the amount of data; note that some of the references are not in this work

method using statistical techniques usually requires more data than that without considering the statistical features.

• Learning-based methods — Learning-based methods utilize machine learning techniques, without considering the physical meaning of the model parameters, to describe more com-plex and underlying nonlinear relationships between different kinds of surrounding traffic information and driver behaviors. For example, neural networks [35], [36], and recurrent neural networks [37] have been applied to modeling, analyzing and characterizing driver behaviors. Therefore, different types of problem formulation require different amount of data.

(41)

Literature review 21

The collection of data varies from work to work, but the most frequent methods for obtaining data are:

• In-vehicle sensor data — The data collected from in-vehicle sensors, such as cameras and/or radar that can sense information about adjacent vehicles in the same lane and driver’s personality, is referred as in-vehicle sensor data. Higgs and Abbas [38] collected the NDD based on in-vehicle cameras, radars, and CAN-Bus signals to analyze a driver’s car-following patterns. Data obtained via the in-vehicle data acquisition system may include data of driver actions/behaviors (e.g., eyes detection, hands detection, and foot action), road features (e.g., road curvature, road/lane width), information of front vehicles (e.g., relative distance, relative speed) and ego vehicle data through CAN-Bus (e.g., acceleration, vehicle speed, throttle opening, steering angle).

Figure 2.12: Example of in-vehicle data acquisition systems developed by University of Michigan [5].

• Video/camera data with a fixed field — A lower cost alternative but efficient way is to install a video recorder at a fixed position, obtaining video-based data (e.g., vehicle tra-jectories and positions) to analyze driver behaviors. This approach has been widely used to collect vehicle trajectory data and analyze traffic flows or build the car-following model. For example, Zhao [39] et al. collected the car-following data by installing a video recorder on the windowsill of a tall building adjacent to the intersection, and then utilized these data to analyze the influencing factors of car-following behaviors at urban signalized intersections, determining the structure of an extended car-following model. Some researchers also fixed the camera/video recorder on a helicopter [40], [41], traffic light signal poles and structures to collect driving data. This kind of data collection method allows researchers to obtain a huge amount of driving data for many vehicles at a lower cost and with less time, though tracking a single driver’s other behaviors, such as steering angle, head movement, and eye information, is difficult. For instance, more than 6 thousand vehicle trajectories in [32] take

(42)

the researchers only about 45 minutes to obtain using this method, but included no data on steering angle, head movement. Therefore, this method is not very used to obtain driving data or for car-following behavior.

Figure 2.13: Illustration of data acquisition systems for car-following behaviors using a cam-era/video recorder with a fixed position.

This article proved essential on defining a method for analysing the exact amount of data needed, and also provided relevant insight the way of data acquisition and processing algorithm. Due to this article, it was possible to estimate the amount of driver’ data needed in terms of amount of minutes, number of trips and amount of drivers. It also provided insight on the amount of data acquisition sensors needed and the sampling rate of each.

2.10

Conclusion

All the articles and papers presented on this chapter helped to achieve the final system and func-tional architecture of the work presented during the next two chapters. They served as an inspira-tion for what already exists in the industry and what could be improved and implemented. Data labeling and clustering was an essential aspect of the work developed, as well, as using a mobile architecture for the system. The theoretical analysis obtained from the above papers helped refine and validate the rule set for analysing a driver’ behavioral profile.

Important to mention that some of this articles provided results that were compared against the results of the work developed that is described during the next chapters. This served as a form of validation of the developed work. Also the state of the art analysis allowed the definition of the overall system processing architecture and data acquisition methods, as well as, an estimation of the amount of data needed to acquire to fulfill a reliable ending.

(43)

Literature review 23

Although not mentioned, more references and works were taken onto account for the system definition and they are mentioned during the next chapters and referenced on the final part of this work. Those works relate more to software development methodologies and system architecture design patterns and were used as technical development references.

(44)
(45)

Chapter 3

Theoretical analysis, Boolean logic and

data acquisition

3.1

Introduction

In this chapter the theoretical analysis for profiling driving behavior is presented in detail. The theoretical analysis is divided onto real life scenario and driving rules enforced by the authorities and the governmental institutions. The majority of the theoretical analysis was obtained from a detailed analysis of the many references detailed in chapter two. Besides those, the theoretical analysis focused on the driving norms enforced by the relevant authorities in Portugal [42] and the United Kingdom [43], since data was acquired and analysed from both places.

Besides the pure theoretical analyses of driving profile behavior, and that deals with question "what makes a driver safer than other", this chapter also details the algorithm used for processing the data. Based on the aforementioned rules and theoretical analysis, a Boolean algorithm [44] was developed as a processing mechanism for the acquired data. That algorithm is detailed in this chapter, as well as the linguistic variables associated with it and the rule set created and finely tuned. The actual code and software implementation of the algorithm is not in the scope of this chapter and is explained in detail on the fourth chapter.

The last part of this chapter details the data acquisition process and logic. Data was a big part of this dissertation and therefore it entails a large part of this work. This chapter describes what type of data was acquired, the sampling rate of acquisition and reasoning behind that sampling rating, the data clustering process and labeling algorithm [45] and finally some data sets are analysed in this chapter as well as some plots can be seen. Complete data sets can be found on appendix Cof this work, and online, on the public real-time data base used for developing of this work.

(46)

3.2

Theoretical Analysis of Driving Profile

This section entails the foreground of the theoretical analysis of this dissertation for profiling a driving behavior. Before working and developing an algorithm for profiling a driver behavior it was essential to know what distinguishes a "good", usually associated with a "safer" driving style, from a "bad", more aggressive driving style. Being the later more prone to road accidents. For that intent various works were studied in detail as well as the guidelines and rules applied in different countries for controlling and maintaining overall road safety.

3.2.1 Country Guidelines

The starting point for the theoretical analysis was understanding the governmental guidelines and rule-set, since the main purpose of those rules is to allow the roads to be used by millions of different drivers simultaneously in a safer manner. Therefore, it’s a good starting point to assume that a "good" driver is a driver that follows the country guidelines for the roads he drives on.

Nowadays, according to U.S. Department of Transportation [46], see table 3.1, driving too fast, also known, as road rage or excessive road aggressiveness is responsible for the largest per-centage of road incidents, many times resulting in serious injuries for the driver, and/or passengers of the vehicle, and/or the other road users. Therefore the relevance and importance of this work that aims to provide real time feedback for the driver on his behavior.

Figure 3.1: Driving Behaviors Reported For Drivers And Motorcycle Operators Involved In Fatal Crashes, 2017

(47)

Theoretical analysis, Boolean logic and data acquisition 27

In Portugal the number of reported road accidents in 2018, was 34 235, with 43 497 injuries and 508 causalities. that gives a percentage of 3.5% accidents per thousand inhabitants, according to [47]. Those numbers can be seen in figure 3.2and similar information can be seen all around the world.

Figure 3.2: Number of road accidents by type in Portugal, Source: ANSR

Performing an analysis on the Portuguese legal system for road safety proved to be the ideal starting point for this work, according to figure 3.3, obtained directly from the Portuguese legal system [42], the speeding values for the different road types are the essential rule set to abide. But, many times, the rules are not followed, either by distraction or negligence.

Figure 3.3: Speed values for the different road types and vehicles for Portugal

Besides the basic driving speeding rules, special cases occur due to adverse weather or road conditions that driver’ must abide.

(48)

The United Kingdom rule system was also taken onto account and used for this work, and therefore is presented at table 3.4and obtained directly from the British legal system [43]. They are very similar to those applied in Portugal, in accordance to the relevant Imperial System in use.

Figure 3.4: Speed values for the different road types and vehicles for the United Kingdom

This proved to be the essential set of rules for analysing driving profile in terms of speeding and all the rules used on the following sections were derived from here based on the location. But, they proved not to be enough, since speeding alone cannot be used as the main indicator for an aggressive driving profile. Acceleration, both lateral and longitudinal proved to be also a good indicator of driving behavior [48] and is, therefore, presented further down this chapter.

Lateral and Longitudinal acceleration as a direct kinematic parameter alone is not a good enough indication for profiling a driver behavior due to the fact that driving is a very complex system, demanding longitudinal and lateral control at the same instant. In order to explain in a more detailed manner the adopted methodology for using the acceleration as a parameter for classifying driving behavior, it was considered that during a curve, the vehicle is subject to a acceleration vector in the horizontal plane where ~a is the complex vector composed of the lateral acceleration value alatand longitudinal along.

Therefore ~a module can be computed as shown in equation3.1: |~a| =qa2lat+ a2

Referências

Documentos relacionados

Ao desenvolver o Produto Educacional “Ensinando perímetro e área de figuras geométricas planas usando o software GeoGebra”, tivemos como objetivo propor aos colegas

aproveito para dizer que Aristóteles não estava assim tão seguro de que fazia o melhor (ou o único bem possível), ou o mais consensual (se não é crime usar tal termo

Knowledge discovery is the process of characterizing, mining and processing data, aiming to extract relevant patterns in large data sets (Tan, Steinbach, & Kumar, 2005).

As estratégias consensuais foram: (1) a criação de unidades de decisão clínica; (2) a criação de equipas de avaliação rápida; (3) a criação de áreas dentro do

The office management is the farm lab command center, represented by a computer based system, having a data warehouse where all the data acquired by the sensor

Based on all the data mentioned above, the objective is to do the nurses schedule, in order to minimize the total time needed to provide all the treatments to all the patients

Esta visou avaliar a prevalência, gravidade e perturbação de acidentes rodoviários, de trabalho, desportivos, domésticos e de lazer e comparar, em função do tipo de acidente

O V Levantamento sobre o consumo de drogas psicotrópicas entre estudantes do ensino fundamental e médio da rede pública de ensino nas 27 capitais brasileiras, revela uma