Road Rage and Aggressive Driving Behaviour Detection in Usage-Based Insurance Using Machine Learning

Driving behaviour is a critical issue in modern transportation systems due to the increasing concerns about the safety of drivers, passengers, and road users. Machine learning models are capable of learning driving patterns from sensor data and recognizing individuals by their driving behaviours. This paper presents a novel framework for aggressive driving detection and driver classification based on driving events identified from GPS data collected with smartphones and heart rate of the driver captured with a wearable device. The proposed system for road rage and aggressive driving detection (RAD) is realized with an integral framework with components for data acquisition, event detection, driver classification, and model interpretability. The system is implemented by generating a prediction model by training machine learning classifiers with a dataset collected in a cohort to classify drivers into good, unhealthy, road rage, and always bad. The proposed system is to improve road safety and to customize insurance premiums in the best interest of policy holders and insurance companies.


INTRoDUCTIoN
Driving behaviours are the main cause of road accidents and one of the main sources of insurance claims.To improve road safety and reduce the number of insurance claims, it is important to identify driving behaviours in order to adapt the insurance contract accordingly.Identifying abnormal driving behaviour is an important task for Usage-Based Insurance (UBI) companies as it can help them to assess a customer's risk and price their policies accordingly.Driving behaviours such as speeding and aggressive and careless driving are of particular interest to UBI companies as they are directly related to an individual's risk of an accident.Car driving behaviours can be measured by data such as speed, acceleration/deceleration, lane position and headway.Accident proneness refers to a general disposition or personality trait that increases the likelihood of an individual being involved in an accident (Shinar, 2017).Differences in accident proneness are generally caused by a number of factors, such as gender, age, personality traits, driving experience, attitude towards driving, road conditions and environmental stimuli.Figure 1 illustrates the factors influencing driver behaviour.
Driving style is defined as a habitual driving behaviour, characterizing a driver's tendencies to behave in specific ways on a regular basis (Sagberg et al., 2015).It also describes how a driver's driving style affects the safety of the individual and others on the road.The identification of such habits has become increasingly important for the development of insurance companies as it can help them to identify high-risk drivers, estimate risk and set an insurance premium accordingly.
Abnormal driving is generally characterized by atypical or risky behaviour that is not in line with the norms for a particular group of drivers (Hu et al., 2017).There are a number of different types of abnormal driving, but the most relevant for UBI are those that are associated with an increased risk of an accident, such as speeding, aggressive driving and careless driving.Road rage is a brief, intense reaction to perceived provocation in a situation of conflict between two or more persons on the road, characterized by verbal abuse, shoving, hitting, threatening and possibly minor or major physical aggression (Shinar, 1998).Aggressive driving is characterized by hostile, impatient and risky behaviour such as speeding, tailgating, weaving in and out of traffic and running red lights.
The World Health Organization (WHO) report on road traffic injuries reveals that around 1.3 million people die in road crashes every year (WHO, 2022).These crashes are identified as causing around 3% loss of Gross Domestic Product (GDP) in most countries.Further, 20 to 50 million people are susceptible to injuries, resulting in disabilities and long-term health conditions.Figure 2 depicts the fatalities in road accidents over the past few years, which are increasing every year.Along with the Bloomberg Initiative for Global Road Safety (BIGRS), the WHO strives to reduce fatalities and help governments develop a long-term sustainable plan for safety and road traffic injury prevention, and define guidelines and principles of a comprehensive road safety approach.Technological interventions in road rage and aggressive driving behaviour are crucial for this objective.
Recent developments such as Drivesafe (Bergasa et al., 2014), a mobile application for alerting and ranking drivers, and Advanced Vehicle Technology (AVT) have led to the development of assistive mechanisms in the detection and reduction of aggressive driving (Furlan et al., 2020;Benson et al,, 2021).AVTs include a wide range of technologies such as anti-collision systems, automatic emergency braking, blind spot monitoring, lane departure warning, forward collision warning, lane change assistance, and adaptive cruise control systems.However, the effectiveness of AVTs in reducing aggressive driving behaviour is still unknown and there exists a possibility of it becoming a distractive technology, frustrating untrained drivers.
Traditionally, motor insurance pricing (Kafková & Křivánková, 2014) is performed with Generalized Linear Models (GLM) (Nelder & Wedderburn, 1972) such as logistic regression (LR), Poisson regression, Cox proportional hazards model, etc.These models use demographic information (e.g., age, gender, marital status, etc.), driving record (e.g., number of accidents, tickets, etc.) and vehicle type as predictors of risk, called the 'priori information'.Later, posterior information about the policyholder is obtained from historical claims data (e.g., total claims costs, number of accidents) or population data (e.g., market share, insurance penetration rate, etc.).This information is used to determine the expected cost, total loss, etc. for a given policyholder as described in the works of Gao et al. (2021) and Corradin et al. (2022).
However, GLMs do not possess the flexibility to learn complex effects from multiple causes as they model only interaction between two factors.In a recent investigation, Blier-Wong et al. ( 2020) have projected the limitations of the usage of GLM in evaluating the risks in property and casualty insurance (P&C) covers that involve multiple behaviour causes.The authors advocate the usage of machine-learning approaches to overcome the drawbacks of GLM models.
Machine-learning models are capable of learning non-linear functions and have shown greater success in modelling complex relationships between inputs and the targeted output.Further, they can handle unstructured data, characteristic of insurance portfolios.Therefore, algorithms that work with training reactive features using data from past claims that have been laid for other policy holders, can help to build a robust risk model.Grize et al. (2020) emphasize the significance of the usage of machine-learning approaches in the insurance vertical when modelling the analytical applications such as risk estimation, premium calculation, profitability monitoring and risk modelling.
Inspired by the pioneering and recent works advocating the usage of machine-learning approaches in the insurance business (Dietterich, 1997;Bian et al., 2018), this research explores the possible uses 1.This research proposes a novel framework for RAD based on the behavioural, environmental, emotional and physiological/psychological factors of an individual for UBI policy planning.2. Conventional machine-learning models such as DT (Quinlan, 1996), RF (Breiman, 2001) and SVM (Cortes & Vapnik, 1995) are modelled as multiclass classifiers to categorize drivers into four types such as good, unhealthy, road rage and always bad.
The proposed framework and the models evaluated with real-time data generalize well with arbitrary data captured in a cohort in India, suggesting the feasibility of deploying such models for RAD in other geographies.
This paper is organized as follows.Section 2 presents a comprehensive review of driver behaviour modelling and applications of machine-learning approaches in the insurance industry.Section 3 presents the mathematical representations of the machine-learning models employed in this research.The proposed framework is described in section 4, and experimental results with illustrations, interpretations and comparative analysis are presented in section 5.The paper is concluded with directions for further research in section 6.

ReLATeD woRK
This section presents an inclusive analysis of literature spanning the earliest to the most recent representative works in the context of this research.Over the past two decades, several approaches for automated driving behaviour monitoring have been proposed (Ji et al., 2004;Al-Sultan et al., 2013).With the evolution of telematics insurance models in which premiums are calculated based on the data collected from vehicle-mounted devices and risk profiles of drivers, Manage-How-You-Drive (MHYD) insurance schemes have become popular (Cieślik, 2017).
Generally, driver patterns are monitored with GPS devices, On-Board Diagnosis (OBD) sensors and smartphone sensors.However, GPS is a passive device and thus is vulnerable to various sources of noise and interference, and GPS-based driver pattern monitoring has been limited to only specific purposes, e.g., driving route tracking and vehicle detection (Chowdhury et al., 2018).OBD sensors such as throttle, brake and steering wheel angle sensors are widely used to collect data from the vehicle (Amarasinghe et al., 2015).Compared with OBD sensors, smartphone sensors have much better data quality due to their higher signal-to-noise ratio and immunity to the power fluctuations of the vehicle (Samuel et al., 2021).As a result, a lot of research has been carried out to monitor driving patterns using smartphone sensors.Driver behaviour modelling (AbuAli & Abou-zeid, 2016;Chen et al., 2019) has been a long-standing area of research with many studies proposed in the past decade towards understanding and detecting driver behaviour anomalies to improve road safety.Several studies have been carried out to identify the features of aggressive driving and road rage incidents and evaluate their effects on insurance pricing (Peng et al., 2015;Gvozdenović and Uzelac 2018;Arumugam and Bhargavi 2019;Naik and Sikka 2021).Further, the outbreak of COVID-19 has considerably affected the road traffic statistics.Insurance companies are facing challenges in risk assessment, policy pricing, personalized claims, etc. due to the fluctuation in accident statistics during COVID-19.A few studies on the impact of COVID-19 on the insurance industry call for adaptation of digital technologies, new data-driven models, telematics and other technologies to achieve a balance between customer experience and business continuity (Katrakazas et al., 2020;Babuna et al., 2020;Volosovych et al., 2021).
The Driving Behaviour Detection and iDentification system (D 3 ) (Yu et al., 2016) identifies six kinds of abnormal driving behaviours such as fast U-turn, sideslipping, sudden braking, weaving, swerving and turning with a wide radius.SafeDrive (Zhang et al., 2017) is a cloud-based driver anomaly detection system based on unsupervised learning, implemented in the Internet-of-Vehicle (IoV) platform.A driving model for quantification of driving style proposed by Shi et al. (2015) is personalized to a driver based on the vehicle and the road conditions.
A model for driving behaviour visualization proposed by Liu et al. (2017) is based on the hypothesis that a few essential features generate multivariate data to model driving behaviours.An approach for driving event detection and driver profiling detects lateral and longitudinal driving manoeuvres with Hidden Markov Models (HMM) and jerk energy technique respectively (Daptardar et al., 2015).A multi-type data-based framework to access the driving risk level for UBI proposed by Yin and Chen (2018) employs a set of kernels to capture attributes.A predictive (Arun Kumar & Yellampalli, 2018) model for auto insurance based on binary LR, called black box, uses GPS data.
Six classification models are proposed by Brahim et al. (2022) for driver behaviour classification into four categories: intermediate, aggressive, dangerous and normal.A framework for driver behaviour and driving pattern modelling based on driver, vehicle and environmental parameters also advocates the application of various ML approaches (Malik & Nandal, 2021).Two most recent works on the application of predictive analytics in the insurance sector show that customer satisfaction, reduction of operation costs and detection of fraudulent claims can be considerably improved with ML models (Sharma et al., 2022;Prajapati, 2022).
A detailed review of the above shows that UBI is the emerging model of personal insurance and will replace the traditional pooling-based models in the near future.It is understood that complexity in risk-based premium computation can be reduced with usage information.Risk assessment with ML approaches for modelling driver behaviours, learning driving patterns and predicting risk classification is key to developing UBI models.Few works have shown that models based on multiple attributes outperform models trained with a single attribute.This review identifies the need for robust models for risk assessment and risk classification based on multiple attributes, and this research is aligned with this requirement.

MeTHoDS
The hypothesis of this research is that road rage and aggressive driving detection behaviour can be predicted by training the machine-learning models with multiple attributes characteristic of the driving behaviour and health of a driver.
LR is a statistical technique for developing a predictive model to determine the probability of an outcome in relation to one or more independent variables.LR is a commonly used tool in many disciplines such as economics, biology, epidemiology and medical research.However, the linearity assumption of LR between independent and dependent variables is often not met in many real-world applications, which can lead to inaccurate results.Particularly, in modelling driving behaviours, it is important to account for the nonlinearity of various factors.Compared to LR, machine-learning models such as Decision Tree (DT), Random Forest (RF) and Support Vector Machine (SVM) can better model nonlinear relationships between independent and dependent variables.
The proposed RAD framework is implemented with a component for driver rage detection using a machine-learning model to classify driving behaviours.Three different baseline models described in the following subsections are trained with driving data to classify driving behaviours.

Decision Tree
A 'DT' (Quinlan, 1996) is a statistical classification system that learns from a set of instances to sort new instances into one or more classes.The DT algorithm constructs a tree-like structure that represents a decision problem.At the root of the tree is a set of test instances.The DT algorithm then recursively partitions the test instances into subsets according to a test criterion.Each node in the tree is a partition of the test instances and is associated with a label that is the result of applying the test criterion to the instances in that partition.The leaves of the tree are the labels of the test instances.The DT learns to classify new instances by traversing the tree from the root to the leaves.

Given a set of instances
, , , , , the DT T is represented as a binary tree with m nodes and l leaves, where x i is the feature vector and each y i is the label of instance i .
Each node v in T has l v leaves, and each of these leaves is associated with a label y j .The decision tree learning method constructs T for a given training set.In the training process, an instance is presented with the corresponding feature vector x .Then the tree T is traversed from the root node to the leaf nodes.For each node v of the tree, the algorithm decides whether to branch to the left or the right child.For each node v of the tree, the algorithm determines a partition p v of the training instances and computes a weight w v associated with the partition.The partition p v is defined by the values of feature vectors in the partition.The algorithm also determines a label y v for each partition.
The label of the instance is determined by the highest weight of the partition, in equation ( 1):

Random Forest
The RF algorithm (Breiman, 2001), is a machine-learning technique used for classification and regression.It computes a series of tree classifiers called DTs, each consisting of a set of rules for classification.The algorithm works by generating a large number of classifiers, each constructed using a different set of features and a different sample of training data.The randomness in the algorithm consists in the fact that each classifier is constructed using a different set of features.The mathematical description of the RF classifier is given as below.
It follows a nonparametric regression framework in which each input vector X is first mapped to a feature space, then to a decision space via a feature mapping function f X f X : → ( ) , then to a response space via a response mapping function g f X g f X : ( ) → ( ) ( ) and finally the response vector Y is obtained by applying a response function h g f X h g f X : , , , , , a set of classification trees T T n 1 , , ¼ are constructed as follows.Each tree T i is a binary tree, where each internal node is labelled by a feature of the input vector X i and each leaf node is labelled by a class label Y i .A training sample is first mapped to the input space using f , then to the decision space using g , and finally to the response space using h .Finally, for each tree T i , the response Y is predicted as a majority vote over all the leaf nodes.For classification problems, the response is set to the class with the largest number of votes, and for regression problems, the predicted response is the average response over all the trees.

Support Vector Machine
A Support Vector Machine (SVM) is a supervised learning algorithm used for classification and regression.It is a type of kernel machine-learning algorithm that uses a kernel function to calculate the distance between two points in a feature space.SVMs are popular for text classification and image recognition tasks.The SVM algorithm works by finding a hyperplane that separates two classes of data as efficiently as possible.The hyperplane is the plane that maximizes the distance between the two classes of data.Points that lie on the hyperplane are classified as belonging to one of the classes, and points that lie outside the hyperplane are classified as belonging to the other class.
The binary SVM classifier constructs a hyperplane to separate two classes labelled y = − + ( ) 1 1 , from each other.An SVM has a decision function as in equation ( 2) where, 1 is a class label, a i Î  and b Î  are hyper-parameters, and K is a Gaussian kernel given by equation ( 3) where s is a kernel parameter: A Multiclass SVM (MSVM) (Weston et al., 1998) is a variant of SVM for one-vs.-oneor onevs.-allmulticlass classifications.The one-vs.-oneMSVM uses a separate binary SVM for each pair of classes and the one-vs.-allMSVM uses a single binary SVM for each class.
The one-vs.-allMSVM used in this research is trained in two phases: 1. Classifying all training points into one of the k classes; and 2. Classifying the remaining points into one of the remaining k -1 classes.
The training data is assumed to be  The  2 regularized linear SVM used in this research solves the optimization problem defined in (4): where C > 0 is a trade-off parameter, x * is a separating hyperplane and y x a

Problem Definition
Abnormal driving behaviours such as reckless and aggressive driving are usually one of the reasons for accidents, which are considered common offences in several countries.UBI is a risk-based insurance model that monitors driving behaviour of a driver on a particular road in real time, which helps insurers to identify potential risks, predict possible accidents in the near future and compute the premium.Unlike the conventional insurance models that classify the drivers into two or three categories based on historic driving data, static speed limits and fixed premiums, a UBI business model dynamically changes the insurance premiums for each driver, based on real-time driving behaviour.
Recently, the outbreak of COVID-19 has significantly reduced the driving activities of millions of people.Usage-based premium computation, which is the mainstay of the UBI business model, is datadriven.UBI companies are now confronting the challenging problem of detecting abnormal driving behaviour of people from limited on-road data (i.e., the time and date of the on-road events) that are either collected manually or through the network of fixed roadside vehicle detection systems.Risk detection based on behavioural, environmental, physiological and emotional factors can help insurance companies to provide personalized insurance premiums and to support drivers in making better decisions.To this end, a combination of machine learning and data science techniques is required to construct such a model.
Foreseeing the growing trend of UBI business models in the future, this research proposes the RAD system to overcome the drawbacks of the conventional models.The proposed model is realized as a multiclass classifier for driver categorization with the following objectives: • To collect the driving data from the live driving environment with the GPS and wearable devices using smartphones.• To classify the drivers into four categories such as good, unhealthy, road rage and always bad: • Good drivers -drivers with an overall driving score above the threshold.
• Unhealthy drivers -drivers reported as having health problems.
• Bad drivers -drivers with a poor driving score, who exhibit consistent irregularity in driving and who have received more warnings.• Road rage/aggressive drivers -drivers who exhibit road rage and aggression, thus have a higher potential for road accidents.• To provide alerts, suggestions or warnings to drivers when they are driving abnormally, to prevent road accidents.
A classification diagram in Figure 3 illustrates the role of the proposed RAD system in insurance pricing.

Proposed RAD Architecture
The proposed RAD architecture consists of four components: data collection, rage and aggression detection, interpretability and UBI calculation, as shown in Figure 4.The data collection component collects the driving data from different drivers in real time.The rage and aggression detection component is trained to classify the drivers from the data collected in real-time.The explainable interpretable engine provides explanation on the behaviour of the RAD component in discerning the drivers based on the data.The UBI calculation engine provides insights to the insurance companies, which then calculate the personalized premium for the individuals.The functions of the individual components are illustrated with Figure 5 and described in the following subsections.

Driving Data Collection
Data is collected from the driving environment in real time by using an iOS app, developed with iOS/ Swift 3.0 technology and installed on the smartphone of the driver.A cloud instance is created and big data/machine-learning technologies are installed in the machine.As soon as the driver starts the vehicle, the data collection mechanism collects the data using the iOS app, with the help of GPS signals and a wearable device.This app will start logging the trip details as soon as driver starts the vehicle and continue until the driver stops the vehicle.A trip is characterized as a drive from a source point to a destination, the details of which are sent to the cloud environment for further processing.Swift 3.0 allows users to configure the desired accuracy of location information with a set of predefined constants.In this research, kCLLocationAccuracyBest is used to capture the location at the best accuracy.This content is added to section 4.2.1.

Rage and Aggression Detection
The RAD process is realized in two sub-phases, namely model generation and prediction.Model generation refers to building a classifier model by training a naïve classifier with driver data.In this research, three classifiers are built with three separate machine-learning models, as discussed in section III.Before training, the missing values are filled with valid values and the data samples are normalized.The trained model is run in the driver's device and synchronized every 24 hours.The arbitrary real-time data samples captured are classified into one of the four driver categories assigning the target labels, and personalized voice alerts are provided for the unhealthy and rage/aggressive drivers.
In RAD, the data flow is seen as a series of transformations of the driver data captured by the data acquisition devices as it passes to the other components until the driving behaviour is classified, as shown in Figure 6.The web portal is developed to check the details about a particular driver at any instant in time.A middleware and integration layer uses a few Representational State Transfer (REST) web services to handle the data flow between the data collection and classification layers.

Interpretability
A critical part of artificial intelligence/machine learning is to understand how models arrive at their decisions.This helps to build trust between the humans and the machine-learning models, allowing the user to confide in the system.Interpretability can be achieved using data-centric visualization, providing additional information about the decision, generating example input/output data, etc.In this research, the interpretability engine visualizes the behaviour of the model by analysing the target labels with respect to the input data.

UBI Calculation Engine
This component includes summary and driving behaviour details, start/end time of journey, data/time and location of abnormal driving behaviour of all drivers.The data summary is published and is readily available to insurance companies to calculate the personalized premium based on driving behaviour.

Implementation of RAD
This section presents a detailed description of the implementation of each component of the proposed RAD system, with illustrations.Each component is designed to have an individualized architecture and functionality, so that it can be easily adapted to the specific needs of the different applications.

Real-Time Driving Data Collection
The proposed system supports real-time data collection in three modes such as black box, OBD II Dongle and smartphone, the characteristics of which are shown in Figure 7.However, due to the merits of smartphone-based data collection such as convenience, flexibility and cost-effectiveness, the system employs smartphone-based data collection, either with built-in sensors or Global Positioning System (GPS).The merits and limitations of these approaches are summarized in Table 1.As hardcornering events are vital in the identification of road rage/aggressive drivers, this research employs the smartphone GPS for real-time data collection.
GPS is a satellite navigation system that emits continuous navigation signals and data, which allows GPS receivers to calculate location, elevation, velocity and time.GPS signals include longitude, latitude, speed, altitude, course and current timestamp.In RAD, an iOS-based app (front end) is developed to collect the driving data from GPS signals and wearable devices.Hard acceleration, hard braking, hard cornering and speeding events are detected based on the GPS signals and explained in detail in section IV.Further, heart rate is captured with a wearable device.

Data Preprocessing
RAD preprocesses the GPS data to eliminate the noise and to consider only the remaining data for further processing.The following are the preprocessing procedures used by the proposed system: • All the signals will be passed through preprocessing module/component for normalization.
• In case the data collection devices receive multiple GPS signals in a second, the last signal will be considered.• Event monitoring is considered for only one minute after the start of the trip (since the frequency of initial GPS readings is not consistent and takes a few samples to calibrate).• Missing data is replaced with the most frequent values.

Data Format
In RAD, GPS data comprises summary and trail details for each driver, with a unique identifier for driver identification as shown in Table 2.A service is developed to fetch the source address and destination address based on the source latitude/longitude and destination latitude/longitude.Likewise, whenever the driver is driving, the app will receive different latitude and longitude points almost every second.For each trip, one summary of information and multiple GPS trails based on the duration of travel are recorded, and are available for the corresponding driver.

Rage and Aggression Detection
This function requires analysis of real-time driving data to identify events such as hard acceleration, hard braking and hard cornering, and speeding incidents.The GPS data are pre-processed and the data-flow depicted in Figure 8 is followed to detect the events.Heart rate is captured from a wearable device and processed as-is.The generation of events and representation of data are presented in Figure 9 with illustrations.

Hard acceleration:
Hard acceleration is a driver event when more force than normal is applied to the vehicle's accelerator, causing the vehicle to cross the permissible acceleration threshold.
It is defined as the difference between the final and initial speeds over a period of time as in equation ( 5).A positive value of this computation signifies hard acceleration:

Hard Acceleration Final Speed Initial Speed
Final Time In = − ( ) 2. Hard Braking: Hard braking is a driver event when more force than normal is applied to the vehicle's brake, causing the car to slow down more quickly than it would under normal driving conditions.It is generally considered to be a warning sign of potential aggressive driving behaviour, resulting in damages to the car and affecting the safety of the passengers.Hard braking is identified by speed changes over a time interval as in equation ( 6).Negative values indicate a deceleration and the absolute value is used to detect hard braking, compared with a threshold: 3. Speeding Incidents: A vehicle speeding over the limit can result in a number of incidents such as injuries, property damage, accidents and fatalities.GPS data can be used to create the ideal vehicle speed profile and flag a vehicle as a potential speed violator.GPS systems in vehicles can Table 1.

Built-In Sensors GPS Advantage
Less cost and less complexity of implementation to obtain the behavioural events such as hard acceleration and hard braking.
Possibility of unstable location of smartphones and identification of hard-cornering events.

Drawback
Maintenance of stable position for the smartphones and identifying the hard-cornering event.
Complex implementation and high cost of computation.
be used to gather data on speeding incidents including speed, time, location, date, etc. Further, these incidents can be aggregated to create a database of speeding incidents for analysis and to identify potential hotspots.

Hard cornering:
Hard cornering occurs when a driver accelerates or decelerates suddenly in a lane, turning a corner at high speed or drifting on the road.Lateral acceleration is an important indicator to identify harsh cornering events, expressed as in equation ( 7) where V and R are the velocity and the radius, respectively.Cornering events will be detected when this value exceeds 21.6 KMPH: 5. Heart Rate Monitoring: Several studies have shown that heart-related events in drivers are associated with an increased risk of accidents, due to a sudden heart attack or arrhythmia, causing the driver to lose control of the vehicle, and often leading to a fatal outcome (D'Allegro, 2017).Further, diabetic events are also found to increase the risk of accidents, as Type 2 diabetes reduces the heart rate.The need for monitoring Heart Rate Variability (HRV) has been advocated in the works of Zheng et al. (2020) and Minea et al. (2021) for a better understanding of how it can be used as an early warning system for detection of high-risk driving behaviour.Hence, in the proposed system, heart rate is being monitored along with driving parameters.
Figure 9d shows the data collected from one driver.The x-axis is the GPS data count, and the Y axis is the heart rate (beats per second).For this driver, the heartbeat ranges from 60 to 100 beats per second.This helps to identify and detect road rage and aggressive drivers.

Driver Data Format:
The GPS data including speed, latitude, longitude, altitude, course and timestamp are received through GPS signals and the heart rate is captured with the wearable device.From this data and the predefined threshold values, the parameter values are derived for cornering, acceleration, braking, speeding and heart-related events.These parameters for driving

Driving Behaviour Detection
The mechanism for driving behaviour classification is presented in this section.It comprises the following two phases: 1. Feature Selection: During feature selection, raw GPS data and heart rate are analysed to remove redundant and irrelevant features, and the parameters for detection of events with respect to acceleration (A), braking (B), cornering (C), speed (S) and heart rate (H) are derived from the raw data.Several analyses with real-time data revealed that the drivers exhibit unique patterns with respect to these parameters in different instances.From the insights obtained with the analyses, it is evident that all the raw data is correlated with the driving behaviours, and the derived parameters are therefore representative of the driver's actions.Hence, the feature set for training and testing the RAD model comprises the A, B, C, S and H parameters. 2. Rage/Aggression Detection: The mechanism for aggression detection is presented in this section.
It comprises model generation and prediction as illustrated with Figure 11.

Model Generation -Modelling Driving Behaviours Using Core ML
The proposed RAD system detects rage/aggressive driving with a machine-learning model.Initially, the model is trained by supervised learning with the feature set comprising the derived parameters under fivefold cross-validation.The classifier is trained to learn driver behaviours from the feature set and to assign one of the target labels-good, unhealthy (UH), road rage (RAD) and always bad-to the data sample.The performance of the model is evaluated with the validation dataset under each iteration, until the model converges to an accuracy of 99%.The algorithm for model generation is given in Table 3 and illustrated with Figure 12.RAD is implemented as a cloud service because the infrastructure of the system is designed and implemented within the cloud so that the data collection and driving behaviours can be conducted in the cloud.However, it is known that driving alerts are safety-critical and their application may suffer from the network delay.So, for quick inferences from real-time data, the model is implemented with On-Device ML.On-Device ML is a popular framework, with APIs designed to support various machine-learning tasks on the device itself.On-Device ML is optimized for on-device performance, Table 3. which minimizes memory and power consumption.Running strictly on the device ensures the privacy of user data and guarantees that the local app remains functional and responsive when a network connection is unavailable.For every 24 hours, RAD uses On-Device ML to share the generated model with the driver's device.

Prediction -Driving Behaviour Detection
Prediction refers to testing the model with an arbitrary dataset of features captured from a different set of drivers considered for training the model.The A, B, C, S and H parameters derived from the drivers' data are fed as input into the trained model.Based on prior training, the model computes the classification score and assigns the target label to the data sample.When the target class is RAD or UH, live voice alerts are sent to the concerned drivers.
Initially, RAD determines the trip duration by recognizing the beginning and the end of the driving events.Once the driver starts the vehicle, RAD receives the GPS data for every one second.From analysing the traces collected in real driving environments, GPS data is grouped as a single frame for every five seconds.RAD keeps computing the average within the single frame and compares the values with the generated model to classify the driving behaviour as shown in Table 4.This process is repeated until the trip ends.The process is illustrated with Figure 13.

UBI Calculation
The UBI calculation engine is fed with the classifier decision, derived parameter values and classification scores from the interpretable engine for premium computation.The proposed RAD framework provides freedom for insurance companies to define their own UBI calculation engines based on the policy, driving data and in-house risk assessment.This framework provides well-defined user interfaces and reporting mechanisms to collect user data and present trip summaries and details to the driver, policymakers, law and enforcement authorities, etc.
An illustration of trip details given with Figure 14 shows two driver instances covered by an insurance company.It is seen that the trip attributes and graphical view can be accessed instantly for premium calculation.Multiple views of this data can be presented to enforce access control.Generally, insurance companies use enterprise servers to run UBI calculation engines in order to log the trips, manage people, raise alerts, schedule activities, implement premium rate changes, etc.As part of this research, a web portal is implemented with HTML 5.0 and CSS 3 for monitoring the drivers in real time, raising warnings, UBI calculation, analysis, etc. Driver classification over a small population grid can be visualized in real time as in Figure 15.
Further, the portal also provides localization of aggressive driving with Google Maps as shown in Figure 16.On detection of aggressive driving near Nanmangalam forest, Chennai on June 1, 2018 at 8:55:07 AM, the voice alert was given by the RAD system installed on the driver's smartphone, and the map was rendered.This feature allows policymakers to investigate the driving patterns in different geographical areas, identify the frequent locations of aggressive driving and decide on the type of driving insurance to be introduced.

eXPeRIMeNTAL ReSULTS AND DISCUSSIoNS
This section presents the experimental setup for training and testing the models, empirical evaluations, performance and interpretability analyses in the following subsections.

Dataset and experimental Setup
The proposed model is trained and tested with real-time data collected from twenty drivers from different vehicles.The data is collected from drivers living in different communities following various commute routes for daily driving activities that include commuting to work, shopping and so on.
On average, each driver may drive 20 to 40 kilometres per day and the driving data is collected for a period of 24 months including hard acceleration, hard braking, speeding incidents, hard cornering and heart rate from all the drivers, for identifying road rage and aggressive driving using smartphones.
In total, the RAD dataset consists of 1761 trips as shown in Table 5.Out of 1761 trips, 1570 trips (89.15%) are proper, 112 trips (6.36%) are invalid and 79 trips (4.49%) have a few missing columns as shown in Table 6.In the dataset, the missing columns are replaced with the most frequent values, ignoring the invalid trips.In this research three discrete models are employed in RAD, which are trained and tested with the valid data subsets as shown in Table 7.

Performance evaluation
The performance of the RAD model is evaluated with accuracy, precision, recall and F1 metrics from the True Positive (TP), False Positive (FP), True Negative and False Negative (FN) values obtained on the classification of test data.Accuracy is a measure of the number of correct classifications expressed as in (8): Sensitivity or recall is the number of correctly identified positive samples out of the total number of positive samples as given in (9): Precision refers to the number of correctly identified positive samples out of the total number of positive samples predicted by the model as in equation ( 10): F1 score is the harmonic mean of precision and recall expressed as in (11).It is used as a reliable measure to evaluate the models trained with unbalanced datasets.The F1 score is more robust to the imbalance in the training data than accuracy, precision or recall, as the harmonic mean is used to balance the contribution of precision and recall, which prevents the metric from being overly influenced by either of them:  8.

Classification Performance Metrics
The metrics evaluate in [0 1], signifying best classification performance when the values are closer to 1.The DT, RF and SVM classifiers are trained and tested with the dataset described in the previous section.The performance metrics evaluated for four-class classification are shown in Table 8.
Further, the classification results are visualized with the confusion matrices, which depict the correct classifications and misclassifications under each category.The confusion matrices for the three classifier models are shown in Figure 17.
It is seen that best overall classification accuracy is achieved with the RF model, which exhibits a smaller number of misclassifications compared to DT and SVM.While the number of misclassifications is 3 for RF, the DT and SVM models make 5 and 9 wrong predictions, respectively.A closer observation of the results shows that a greater number of erroneous predictions are evidenced from the good to unhealthy categories, viz.2, 3 and 6 for RF, DT and SVM classifiers.Further, it is seen that all the data samples under the unhealthy category are correctly classified by the three models.Further, road rage cases are also identified perfectly by RF and DT, and 1 misclassification is evidenced with SVM.This result shows that the models are sufficiently trained to discern the driver categories.However, the highest number of misclassifications from the good to unhealthy categories in each model signifies more FPs that must be eliminated.

explainable Analysis
Conventional machine-learning models are seen as black box models, the predictions of which are not easily interpretable (Alwosheel et al., 2021).In order to understand how a machine-learning model works and to identify which factors influence the predictions, it is often necessary to interpret the model behaviour.Explainable analysis facilitates such interpretations by enabling the user to understand the input features that the machine-learning model uses to make the predictions.Explainable analysis is significant in the context of this research, as the insurance companies need to provide a user with an intuitive explanation of the factors that lead to driver categorization, to establish trust.Further, this analysis also helps to identify and eliminate trivial features, and debug and optimize the model.Two significant works on explainable analysis with respect to travel domain are presented by Alwosheel (2020) and Barbado and Corcho (2021).
The explainable analysis pipeline for RAD detection is shown in Figure 18.This analysis is performed with the DT, RF and SVM classifiers employed in this research to analyse their behaviour with respect to input features.This analysis presents insights on which of the derived parameters influence the classifiers' decisions and also helps to guide the drivers towards modifying their behaviour to minimize their risk of being classified as aggressive.
Interpretable machine-learning models possess one or more of the following features for analysing their behaviour.In this context, the capabilities of the RAD model are illustrated with Figure 19.
• Text explanation: Ability to generate textual explanations from the model predictions.
• Visual explanation: Ability to provide visual interpretation of model behaviours for post-hoc analysis.• Local explanation: Ability to segment complex solution spaces into smaller subspaces and provide explanations in terms of solutions to less complex problems.• Explanations by example: Ability to extract data samples related to the result to understand the whole model.• Explanations by simplification: Ability to build a whole new system posing less complexity from the trained model.• Feature relevance: Ability to clarify the inner functioning of a model by computing a relevance score for its managed variables for post-hoc analysis.
The interpretable analysis for four driving instances is given in Table 9.The class score for each target class is given with values of the derived parameters.It is seen that driver #9 is classified always  9. Interpretability Analysis bad with respect to B, S and H parameters.This analysis alerts the driver to correct the braking and speeding activities and take care of their health.
Further, local explanations for the four classes of drivers are shown in Figure 20.The ideal values of the parameters is given for each class for a clear understanding of the driving behaviours in real time.Visualizing these parameters on the dashboard can help the driver to control the driving behaviour to avoid adverse outcomes.

Comparative Analysis and Discussions
Experimental results show that the proposed RAD system exhibits best classification accuracy with the test dataset.Since the existing models are trained with different datasets, the RAD system cannot be compared with them based on quantitative metrics alone.For a fair comparison, a comparative analysis with the state-of-the-art systems is presented in Table 10, highlighting the merits and limitations of these systems.
This analysis shows that the proposed RAD system is unique among its kind for aggressive driving detection for personalized insurance computation that considers behavioural, environmental, physiological and emotional factors.The proposed RAD system has a distinct edge over other systems as it considers the various parameters that affect the decision making process, enabling insurance companies to identify high-risk drivers at an early stage to avoid accidents.The alert mechanisms incorporated into the system can further reduce risk-proneness, as the system is implemented in the cloud, raising the possibilities of real-time monitoring and preventive measures.
Further, unlike other systems, the proposed model does not use the raw data captured directly from sensors.The DT, RF and SVM classifiers are trained with features characterising adverse driving events, derived from raw data and heart rate, resulting in a highest classification accuracy of 98% for the RF classifier.This result is indicative of the fact that the RF classifier is able to learn the complex patterns associated with the driving behaviour data and can be effectively used for the detection of rage/aggressive driving.Basically, RF poses some advantages such as flexibility, minimized overfitting, fast learning and ability to capture the nonlinear patterns in the data compared to other machine-learning models.Further, the RF-based rage/aggressive driver detection model shows good generalization performance on unseen data due to its ability to randomly select a subset of features at each iteration during the learning process.The machine-learning models can be tuned to specifically detect the behaviour that is of interest, and this can lead to better detection performance.
However, certain limitations of the proposed RAD system listed below must be addressed in future: 1. Aggressive driving behaviour is a complex phenomenon that requires extensive behavioural, environmental, physiological and emotional factors to be considered.These factors are often dynamic and are not always consistent.Thus, the proposed model is not a complete and robust system, but can be used as a preliminary tool for proactive driver risk assessment.This drawback can be overcome by training the models with grid-wide data, considering the changes in factors and driving behaviours over time.2. The dataset used in this paper is obtained from a single cohort in India.The accuracy of the dataset might be different in other countries and cultures.For this reason, the model developed in this paper should be validated with datasets from other sources.

CoNCLUSIoN
The objective of this research is to deploy an automated system for detection of aggressive driving behaviour using a machine-learning model capable of detecting driving behaviours at four levels of aggressiveness-namely, good, unhealthy, road rage and always bad.The proposed RAD system features an integral framework comprising a classifier model, interpretability engine and alerting mechanism.The classifier model is trained with behavioural, environmental, physiological and emotional factors, facilitating differential profiling and personalization of the driving behaviour, essential for risk-based insurance pricing.The proposed system is tested with DT, RF and SVM models demonstrating the best classification accuracy of 98% for the RF classifier.
The proposed system can be extended to accommodate the dynamics in telematics data, sensor capabilities and evolving smartphone technologies in detecting the driving behaviours.Particularly, the effects of pandemics are highly pronounced in road safety due to stringent regulations imposed by governments, changing the mobility frequencies and commuting distances of road users.The traffic data captured is minimum, when the travel restrictions are in place.This scenario makes it difficult for UBI models to assess risks and make inferences on driving behaviours using this data.
The proposed RAD system can be finetuned to accommodate the changing context of road user mobility and behaviours by analysing time-dependent changes in data to enhance insurance pricing and risk management.
Figure 1.Factors Influencing Driving Behaviour

Figure 2 .
Figure 2. Yearly Fatalities in Road Accidents Figure 3. Classifications of MHYD Figure 4. Proposed RAD Architecture Figure 6.Data Flow Architecture Figure 7. Devices for Data Collection