A Fuzzy-Logic Approach to Dynamic Bayesian Severity Level Classification of Driver Distraction Using Image Recognition

Detecting and classifying driver distractions is crucial in the prevention of road accidents. These distractions impact both driver behavior and vehicle dynamics. Knowing the degree of driver distraction can aid in accident prevention techniques, including transitioning of control to a level 4 semi-autonomous vehicle, when a high distraction severity level is reached. Thus, enhancement of Advanced Driving Assistance Systems (ADAS) is a critical component in the safety of vehicle drivers and other road users. In this paper, a new methodology is introduced, using an expert knowledge rule system to predict the severity of distraction in a contiguous set of video frames using the Naturalistic Driving American University of Cairo (AUC) Distraction Dataset. A multi-class distraction system comprises the face orientation, drivers’ activities, hands and previous driver distraction, a severity classification model is developed as a discrete dynamic Bayesian (DDB). Furthermore, a Mamdani-based fuzzy system was implemented to detect multi-class of distractions into a severity level of safe, careless or dangerous driving. Thus, if a high level of severity is reached the semi-autonomous vehicle will take control. The result further shows that some instances of driver’s distraction may quickly transition from a careless to dangerous driving in a multi-class distraction context.

Fuzzy logic allows designers to model complex system controls, thus providing a non-complex way of achieving a more concrete approach to reducing uncertainty in knowledge-based systems. Uncertainties in human behavior are typically measured using fuzzy systems, most especially in the context of driving behaviour which is highly unpredictable. Abnormal behavior from driver distraction is the cause of 95% of road accidents [1]. Driver distractions have varying impact, and measuring the severity of distraction is crucial to enhancing Advanced Driver Assistance Systems (ADAS) [1]. Moreover, driver distractions are very difficult to predict. A system that can enhance the prediction of The associate editor coordinating the review of this manuscript and approving it for publication was Yanli Xu . driver distraction to some degree is crucial to preventing road accidents.
Ohn-Bar et al. 2014 [2] characterized driver activity by head, eye, and hand cues using a Multiview vision framework that uses two videos, one observing the driver's hands and the other the driver's head. However, the focus was on a single activity and a hand control.
Indeed, most in driver distraction research that uses activity detection and recognition has mainly focused on a single activity rather than considering multi-class distractions simultaneously. This can compromise the prevention of accidents. In a related system, the prediction of vehicle crash severity using a fuzzy-logic model has been carried out using acceleration data from vehicle dynamics (vehicle jerk) [4]. However, here we used a system for the detection and classification of multi-class distractions, including hand position, VOLUME 8, 2020 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ face orientation, distraction activity and previous driver distractions. The consideration of all of these factors is vital in improving ADAS. Furthermore, we used a naturalistic driving study (NDS) as a driving dataset instead of driverperceived distraction, because the NDS approach measures value or activity more precisely. The multi-class distractions can be classified by severity level. Safe driving is achieved when the driver can remain focused, observe weather conditions and road traffic signs, maneuver with both hands on the wheel, paying attention to the road ahead, and finally yet most importantly abiding by the driving laws. Careless or distracted behavior may consist of using a single hand on the wheel, talking on the phone, texting, talking to a passenger, or turning the head sideways and not paying attention to the road. Increasingly, many drivers can engage in multiple distracted behaviors at a given time, resulting in distractions that can have a highly severe impact. Thus, there is a need to classify distractions into different severity levels. The line between careless and dangerous driving can be subjective and introduces a lot of uncertainties.
An NDS video consists of a sequence of images (frames) and thus can detect continuous distraction in the driver's behavior using different metrics. The driving data images we used to predict the severity of driver's distraction combined different metrics using an Image-Based Discrete Dynamic Bayesian Fuzzy Logic (Fuzzy Logic-DDB). The validation of our driver distraction severity level model using the aforementioned metric can thus lead to a severity level classification of driver distraction in a semi-autonomous vehicle transition situation that could be deployed in ADAS.
Thus, the main contributions of this study are: • A rule-based detection and classification of driver's distractions • A dynamic Bayesian fuzzy-logic model for severity classification • Classification of driver's distraction into degree of severity levels such as safe, careless or dangerous driving.
The rest of the sections are organized as follows. Section II presents a literature review of related work. Section III introduces the case study and data transformation and then describes the method to extract the distraction features and assign a severity classification. Section IV describes the dynamic Bayesian fuzzy-logic model and provides a comprehensive evaluation and metrics. Section V describes the implementation, and Section VI presents the results and discussion. Lastly, Section VII draws the conclusion and proposes future work.

I. RELATED WORK
Sato and Akamatsu [3] stated that driving task difficulty is determined by the interaction between driver capacity and task demand. As the driver's perception changes with increased tasks, the driver's ability decreases temporarily. In addition, fuzzy logic was used to clarify typical driving behaviors using perceptions and conditions such as physical space (feelings of speed, relative distance) and changes in road and traffic conditions. However, the aftermath of distraction event was considered, rather than ways to improve ADAS that might limit the impact of distraction.
Aksjonov et al. [4] developed a novel method for the evaluation of driver distraction while performing a secondary task. The system involved a development of a fuzzy inference system based on simple matrix operations. A simulation of driver's activity, and performance was evaluated in the vehicle measuring the driver's ability to stay in lane and maintaining vehicle velocity. The only secondary distraction considered in the study was text messaging, which is a limitation.
Aksjonov et al. [5] proposed a novel driver performance model that is adaptive to every driver using a neuro-fuzzy inference system. The proposed method was performed using a separate vehicle simulator for each driver. The driver model proposed has two inputs: road curvature and road speed limit, which together predict speed error and deviation from the lane line. The experiment involved 18 participants with valid driver's licenses. They applied an Artificial Neural Network (ANN) with 500 neurons and adaptive neurofuzzy inference system (ANFIS) using a membership function (MF) with 81 rules generated after training. For each individual driver, 80,000 nodes were collected. Training and testing data utilized were 67% and 33% respectively. The result showed the ANN and ANFIS have similar driver modeling results. The ANN and ANFIS are compared on the prediction accuracy with the ANN performing better than the ANFIS model. The input has three Membership Functions (MFs) and the system has two class inputs and one output, with nine rules for the fuzzy logic evaluator.
Aksjonov et al. [6] also developed a methodology to detect normal driving and measuring errors from secondary tasks and total distraction evaluation. The measures compare normal driving with secondary task using fuzzy logic algorithms. Driver distraction in the form of talking on a cell phone was observed, and the ability observe speed limits and refrain from deviation from the middle lane of the road were measured. The result showed that 20% of driver distraction resulted from abnormal driving while engaged in during phone activity.
Subsequently, Eraqi et al. [7] utilized the first publicly available dataset, with more distraction postures than existing alternatives, to identify drivers distractions. The system consisted of a genetically-weighted set of convolutional neural networks, demonstrating that a weighted set of classifiers using a genetic algorithm provides greater confidence in classification. They also researched the effect of different visual elements on distraction detection through face and hand positions as well as skin segmentation. Finally, they introduced an ensemble that can achieve an accuracy of classification of 84.64% in real time.
Finally, Abouelnaga et al. [8] used the distracted driver dataset for posture estimation by proposing a novel system that achieves 95.98% accuracy in estimating driving posture classification. The adopted Convolutional Neural Network (CNN) algorithm for posture classification from regions such as face and hands. However, this study did not consider the impact of the combination of possible multi-class distraction that could highly impact the degree of distractions into severity levels.
Riaz et al 2018 [9] adopted fuzzy logic in driver distraction evaluation system in road safety from artificial human driver emotions. Their hypothesis is that emotions overrides drivers decision making. They proposed an Enabled Cognitive Driver Assistance Model (ECDAM) which computes the external factors and distraction level of the driver. The model triggers when the driver distraction crosses a threshold by sending two sound alerts to the driver to take appropriate actions.
Munyazikwiye et al 2015 [10], predicted vehicle crash severity from vehicle data such as acceleration. Fuzzy logic was used in analysing crash dynamics using the acceleration signal to generate two inputs car jerk and kinetic energy. The result shows jerk contributes much to the crash than the kinetic energy of vehicle. However, reducing the impact of a vehicle crash by reducing driver distractions that could impact vehicle dynamics leading to a crash is vital.
Upadhya and Vinothina 2019 [11], adopted the use of fuzzy logic for analysing possibility of road accident for different distraction parameters. The factors that was used as a metric is alcohol consumption, driving speed, drivers age and infotainment system usage. The findings show that different distractions plays vital role in accidents. However, a study of which of the distractions plays a vital role should have been considered which is a limitation.
Kim et al 2019 [12], proposed a fuzzy logic systems that makes decision and prediction of pedestrian intentions from distance, position, movement direction extracted using computer vision. This resulted in a pedestrian protection systems leading to a pedestrian's risk level. However, having a system that correlates the drivers behaviour in response to pedestrian behaviour will is crucial.
Salleh et al 2017 [13], proposed an Adaptive neuro-fuzzy inference system (ANFIS) for estimation model that yields results approximately with high degree of accuracy in fields such as transportation, engineering and medicine. However, a limitation of ANFIS is high computational cost due to complex structures. They proposed to remove complexity by removing the fourth layer.
Dobbins and Fairclough 2019 [14], proposed the use of fuzzy logic Mamdani to estimate different category of driving context monitoring stress encountered by drivers. The experiment involved only two contextual inputs speed and traffic density. However, deducing stress level from human activity recognition (HAR) and cognitive perspective using techniques such as computer vision, electroencephalogram (ECG) and Deep learning is ideal. Thus, prevention of behaviour that can lead to aggressive driving such as over speeding.
Ondogan and Yavuz 2019 [15], proposed the use of Fuzzy logic in the development of an Advanced Driver Assistance Systems (ADAS). The application is the development of a Lane tracking assist, collision avoidance and Adaptive Cruise Control (ACC). This method is based on monitoring two key factors, speed and stress levels of the driver, the problem with this approach is that driving fast is not necessarily stress induced and can relate to a number of factors, the driver may be distracted by ulterior motives such as being on the phone to potentially get home early or other such emotions that can be recognized using image recognition that classes these distractions as a severity level.
In our present study, we have adopted an NDS dataset which includes activities such as talking to passenger, texting, phone usage, adjusting radio, etc. We focused on talking to passenger, texting, and phone usage, which are prevalent driver distractions. Furthermore, multi-class distraction activity was considered in this work, since the aforementioned distractions all have a different impact on the driver depending on the driving context.

II. CASE STUDY & DATA ANALYSIS
We used a data set from the American University in Cairo (AUC) Distracted Driver Dataset V2 [16] obtained from the Machine Intelligence group at the American University in Cairo (MI-AUC). The dataset is the first publicly available dataset for distracted driver detection. The study involves 44 participants from seven different countries: Egypt (37), Germany (2), USA (1), Canada (1), Uganda (1), Palestine (1), and Morocco (1). Out of all participants, 29 were males and 15 were females. Some drivers participated in more than one recording session at different times of the day, in driving conditions, and wearing different clothes. Videos were shot in five different cars: Proton Gen2, Mitsubishi Lancer, Nissan Sunny, KIA Carens, and a prototyping car. We extracted 14,478 frames distributed over the following classes: safe driving (2,986), phone right (1,256), phone left (1,320), text right (1,718), text left (1,124), adjusting radio (1,123), drinking (1,076), hair or makeup (1,044), reaching behind (1,034), and talking to passenger (1,797).
The sampling is done by inspecting the video files manually and giving a distraction label for each frame. The transitional actions between each consecutive distraction types are manually removed. Table 1 shows a sample of three of the ten classes from the dataset used in this paper. The frame statistics selected are ones with the driver performing activity such as Phone right, Text right and talking to passengers sequentially for a period of time.

A. JUSTIFICATION OF METRICS 1) PASSENGER TALK
According to Hole [17], chatty passengers seem to pose less danger than mobile phone conversations. The second passenger becomes the driver's second pair of eyes, moderating the interaction as road hazards occur. Therefore, when the driver's face orientation is on the road while talking to passengers, we assign less weight. However, in cases where the driver's face orientation is off the road and talking to the passenger, the weight is higher but lower than text and telephone use as explained above. Ferdinand and Menachemi [18], using empirical articles published between 1968 and 2012, developed a logistic regression model to find the association between driving performance and engagement with a secondary task. The result of the analysis shows that talking to passengers constitutes about 29.2% of driving distractions [18].
In addition, Foss and Goodwin [19] conducted research on driving distractions among adolescents by collecting vehicle kinematics data from 52 high schools using unobtrusive event-triggered data recorders obtaining 20 seconds of audio, video and vehicle kinematic information when triggered. The findings show that electronic devices constitute 6.7% of the single source of distraction, with 6.2% from adjusting the vehicle and 3.8% from grooming [19]. Furthermore, they deduced the driver distractions using the statistical approach of detecting and counting the number of occurrences of the distractions.
It can be argued the root of driver distraction comes from three inputs: physical (i.e., hands), cognitive activities, and visual. Physical activities constitute activities such as texting, phone usage, and adjusting infotainment. In contrast, detection of distractions that can impact cognitive abilities, thus reducing effective decision making, is critical. Such distraction may include texting, which can also be classified as a visual activity.
Moreover, driving itself is both a visual and cognitive activity. However, the visual aspect of driving takes precedence over cognition as used in decision making or perception. Cognitive distraction may include talking to a passenger or talking on the phone, which can be severely impacted by the nature of the conversation. Multi-level distraction involving all the three inputs may occur, which could increase the severity level (and degree) of the distraction. For example, texting involves all distraction inputs concurrently, which may have a serious impact on the nature of the individual driving. The degree of distraction can also be measured over the course of a trip, using a time series method to measure the duration and frequency of the distraction as well as the level of engagement with the source of distraction.

2) TEXTING
According to National Highway Traffic Safety Administration (NHTSA), texting is the most severe type of distraction with respect to accidents on the road. A test case from the NHTSA shows that texting for a period of 5 seconds is equivalent to driving at 55 miles per hour (mph) across an entire length of a football field with one's eyes closed [20]. Salleh et al. [13] and Dobbins and Fairclough [14], stated that 28% of teens admitted to using their mobile devices while driving and that this adversely reduced their driving ability. Their report further stated that 52% said texting at wheel is less common but that they talked on a cell phone while driving. The survey findings show that teens also admitted texting while driving which means taking their eyes off the road. and that it is not safe to text or talk while driving.

3) PHONE USAGE
Hole [17] proved that using phone hands-free is equally as distracting as holding the mobile device because conversations cause the driver to visually imagine what is discussed. Hole further stated that the type of discussion at the other end of the phone has a significant impact not just on the mental processing but also on the facial expression that could further increase the distraction level. The duration of use (time), discussion type, and frequency of use during the journey were used as metrics in the research. In addition, talking in person involves non-verbal cues that make the conversation less mentally demanding than a phone conversation. A phone conversation is much more demanding because visual imagination creates competition for the brain's processing capacity, thus drivers miss vital road hazards.
Drews et al. [23] examined the difference between cell phone conversation while driving and conversing with passengers. They compared how drivers were able to deal with the demands of driving when conversing on a cell phone, with a passenger, and when driving without any distraction. The results showed that there was a higher driving error with cell phone usage than with passenger conversation. During a phone conversation, the driver's ability and speech coordination decreased in response to an increase in the demand of the traffic. The results indicated that passenger conversations differ from cell phone conversations not only because the surrounding traffic becomes a topic of the conversation, thus helping both driver and passenger to share awareness, but also because the driving conditions also have a direct influence on the complexity of the conversation, thereby mitigating the potential negative effects of a conversation on the driver's focus and concentration. In this study, we applied weights to our data based on the potential risk of the activity, with texting being the most dangerous activity followed by phoning and talking to passengers, respectively. However, there could be an instance when the activity of talking to a passenger in combination with other distractions will be equivalent to the danger of texting.
The dataset consists of images that were labeled according to the driver's activities during the driving video, after deriving the feature extraction based on the class of the distraction. Using MATLAB's 2019b Image Labeler Toolbox and Graphical User Interface (GUI) editor, the images were tabulated as ground truth labels and regions of interest (RoI),     which were then adopted into fuzzy sets for classification of the distraction by severity level. Per class, 150 images were labeled with a minimum of three behaviors observed (driver activity, face orientation, and number of hands on the wheel). Figure 1 depicts the ground truth label driver talking to passenger, implemented on the dataset in which the driver performed the multi-class activity of talking to a passenger, face orientation off the road, and both hands on the wheel. In Figure 2, the dataset entails the driver performing the multi-class activity of talking to a passenger, face orientation off-the-road, and single hand on the wheel. Figure 3 shows the multi-class activity of talking to a passenger, face orientation on the road, and both hands on the wheel. In Figure 4, the multi-class activity is texting, face orientation on road, and single hand on the wheel. In Figure 5, the multi-class activity is talking on the phone, face orientation off road, and single hand on the wheel. There were few observed instances of the driver face orientation off road, both hands off the wheel and phoning consecutively for a period of 1 second (25 fps). The dynamic Bayesian model for severity classification is narrowed down to the distraction of the physiological features that can be detected by our algorithm and distraction present in the dataset.
We considered four inputs for the fuzzy set: hands, face orientation, driver activity, and previous driver activity. The first frame of change is always where r = 0. When there is no change in distraction profile from the previous frame, then r increases. Essentially, the value r is the first occurrence of the distraction. The distraction severity is computed as (f n−1 . α) where α is the distraction likelihood function which determines how long the distraction has been repeated. The likelihood of the first occurrence in a frame is β 0 , f n−1 is the prior evidence.

III. DYNAMIC BAYESIAN FUZZY-LOGIC MODEL
To build our distraction severity predictive system using dynamic Bayesian methodology correctly, we developed a formal model for distraction severity based on two probability distribution components, namely future distraction likelihood and prior beliefs/observation of distractions in our dataset. For the distraction type likelihood function, the probability of occurrence of the same pattern of distraction types over a particular number of sequential (contiguous) frames is given by where β 0 is the likelihood probability of the first occurrence of some new distraction type and the exponential function 1 − 1 r is the probability of its continuous occurrence in subsequent frames where r > 0.
For observation of driver distraction features, prior evidence based on ground truth labeling of the belief constitutes the second component of probability for the distraction severity level classification model. This probability function is defined as The distraction severity probability is weighted by the normalizing constant τ α , that is, how strongly each element of the observatory dataset is believed to contribute to the distraction severity level classification (τ α , = number of observable events). In this case, face orientation fo 1 x , driver activity da 2 x , and hands on wheel ha 3 x are all normalized between the interval [0,1] and represent prior evidence for the driver's distraction features, namely facial orientation, activity (talking, texting, or phoning), and hand gestures (single hand or both hands on the wheel). Finally, the overall distraction severity level classification prediction is formulated as a discrete dynamic Bayesian network (dDBN) model: (3) VOLUME 8, 2020 We apply this dynamic Bayesian model to generate our test dataset from the greater Distracted Driver Dataset. At the first timestamp (i.e. t = 0) in the video frames, we assume the severity probability is zero. If this is the first occurrence r = 1 of the distraction feature pattern, then only the likelihood probability is applied to the computation of the severity. In subsequent occurrences, the severity probability is computed applying the dynamic Bayesian network model described earlier. This transformed test data would form the basis for evaluation of our novel fuzzy-logic-based inference system for severity classification of driver activities that result in the driver being distracted. The occurrence of secondary distraction within a certain duration can change the degree of severity of an event from careless to dangerous. Ideally, there will be the justification of the minimum threshold required for a distraction to be classified into ''safe,'' ''careless,'' and ''dangerous'' severity levels, respectively. For example, detection of an event such as a hand gesture (seat belt adjustment, wave to passersby, panel adjustment) for a period of 10 seconds could be classified to as careless. We proposed different measures for the driving performance by considering physiological features such as hands, face orientation, and distraction type (talking, texting, phoning). Talking, texting, and phoning were considered due to the cognitive distraction associated with it. For example, in a multi-class distraction, a measure of how long the driver has been talking in combination with other features such as hand and face orientation can increase the severity of distractions. We deduced the time from the rate at which the frames were generated at 25 frames per second (fps). For example, a sequence of frames with the distraction type ''talking'' was used to measure the duration in which the driver was talking. The coding was done such that when a threshold of 125 consecutive frames is reached (equivalent to 5 seconds), then a classification decision is made.

IV. IMPLEMENTATION
Our system is based on the Mamdani fuzzy inference model as shown in Figure 6. The Mamdani approach is commonly used for expert knowledge acquisition. It helps us to explain experience more intuitively and in a more human way. The aforementioned approach is well suited in decision making context with uncertainties that requires human expert knowledge.
The Mamdani is used to imitate the performance of a real driver and his behavior in a driving vehicle. Each input is given a specific amount of MFs and a value and then compared with other inputs. We developed a multi inference Mamdani fuzzy model that attempts to use multi-class distraction detection to classify safe, careless and dangerous driving. The rule generation process was deduced from supporting literature. The justification of weights to each distraction was deduced based on literature from experts on each distraction type. The feature extraction method involves labeling of the RoI, which will be integrated with the fuzzy rules that are created. The distraction training data is made up of classes with activities such as talking to a passenger, texting, and phoning. In addition, we further divided the dataset into subclasses (single hand on wheel, talking to a passenger, and face orientation off the road), and the same applies for the testing data, which are then used for validation. The rules were inserted into the fuzzy inference engine for distraction detection. The interface engine uses the Mamdani inference that conforms to our model architecture. Data pre-processing for extracting was done using MATLAB 2019b ground truth labeling for feature extraction. Furthermore, MFs, associations, and rules were associated with each classification. The rules associated with each classification of driver distraction was further tested using test datasets.
The distraction severity level is a measure of the degree of the impact of driver distraction on driving performance. In addition, classification of the driver's distraction into severity levels is vital in determining the readiness of semi-autonomous vehicle transitioning when a certain threshold of distraction is reached. After all these steps, the fuzzification process will begin decomposing a system input and/or output into one or more fuzzy sets. Many types of curves and tables can be used, but triangular or trapezoidal-shaped MFs are the most common since they are easier to represent in embedded controllers. Figure 7 shows a system of fuzzy sets for input with triangular MFs. Each fuzzy set spans a region of input (or output) values graphed against membership. We restricted our scope to activities leading to distractions in driving behavior: four parameters were used in detecting severity of the driver distraction, namely face orientation fo x , driver activity da x , the number of hands on the wheel ha x , and the previous driver activity Pda x .

A. MULTI-CLASS DRIVER DISTRACTION SEVERITYSCALE
The prevalent approach to the analysis of driver distraction is through the detection of driver activity. However, the physiological features used in driving do have different levels of coordination, thus the impacts of their actions are not equivalent. In addition, our hypothesis depicts that driver distraction may have a different impacts depending on the severity level classifications.
We tested our hypothesis that driver distraction has varying severity levels by deducing, from the literature, the justification of metrics for different types of distraction obtainable in the dataset. The ratings of the severity level of each distraction are developed on a 3-point scale ( Table 2 ) based on the Likert Scale [17], [18]. The category of the severity level is the output of elements represented by MFs: safe driving = 0 -0.25, representing a safe driving with credible false distraction and acceptable event such changing gears; careless driving = 0.25 -0.75 meaning a multi-class distraction or a combination of distractions may occur; and dangerous driving = 0.75 -1.0 signifying a highly critical distraction.
In fuzzy logic, a rule base is constructed to control the output variable. A fuzzy rule is a simple IF-THEN rule with a condition and a conclusion. In Table 2, sample fuzzy rules for the temperature control system in Figure7 are listed. A sample of 3 of 16 rules of Mamdani fuzzy logic inference system for detecting the driver's distraction severity is as follows:

V. RESULTS AND DISCUSSION
In this section, the outcome of the frame-based rule-based fuzzy logic for the driver's distraction severity classification is discussed. The results of the driver distraction are evaluated by testing the unseen dataset without the fuzzy rules.
The plot in Figure 8(A) represents a comparison between face orientation and previous driver activity. In this case, observation shows a plateau region of yellow color, referring to a uniform level in the severity of driver distraction. The steep rise in blue is a result of the face orientation changing at around 0.4; this indicates that the driver's face (and therefore gaze) is moving away from the road, leading to a higher level of severity. The blue curved region shows driver distraction with face orientation on the road level prevalent on a scale of 0 to 0.4, and afterwards a change occurred in drivers distraction with face orientation off road thus, leading to an increased distraction severity level. Even if the participant was familiar with the road, the distraction exhibited dif- fered, especially in the context of multi-class distractions: for example, there was a higher frequency of the driver looking sideways. In addition, we detected more instances of careless driving than dangerous driving. However, we detected a driver who exhibited talking and face off the road for more than 5 seconds; this is highly severe and could lead to a fatal accident.
In Figure 8(B), Face orientation is compared against driver activity (talking), and distinguished sections can be seen. The darker blue represents safe driving, but as the driver starts talking with the passenger, the cyan color appears, reaching to a high distraction level and potentially leading to careless driving. Subsequently, it transitions into a dangerous driving when a higher severity level is reached as driver takes eyes off the road.  In addition, the yellow region depicts increased severity level of distraction, caused by face orientation off road. Figure 9(A) depicts how driver face orientation impacts distraction severity when the activity (phoning) occurred with a long duration. In addition, there was a sharp rise at 0.4 when the driver's face orientation turned off the road. Figure 9(B) shows a steady occurrence of face orientation off the road while talking on the phone, thus leading to a higher severity level of distraction. Figure 9(C) depicts face orientation off road, which persists until 0.4 and changes to face orientation on road. In addition, there was a momentary occurrence of single hand on wheel while the activity persisted and thereafter some instances of no hands-on wheel, thus contributing to a sharp rise in the severity level of the driver distraction. Figure 10(A) shows that face orientation contributes significantly to the severity of the activity of texting. Face orientation off the road and texting together result in a sharp increase in the severity level of driver distraction. In addition, Figure 10(B) shows that the driver performed the texting activity continuously for a period of 2 seconds, which further increased the severity level. Figure 10(C) depicts instances of the driver using no hands at 0.3, with face orientation off   road, and that severely impacts the severity level of driver distraction, leading to categorization as dangerous driving.
Collectively, the plots show that there is a correlation of distraction severity level between the activity (talking and texting) due to the likelihood of the driver's face orientation being off the road. Table 2 defines the input values that are gathered from the dataset of image labels. These values are exported from the labels and put into binary values, where 0 = false and 1 = true. The previous driver activity is determined from calculating the previous frame.
Tables 5, 6, and 7 depict the multi-level distractions input test data, the previous frames distraction severity level, and the defuzzification methods outputs. The defuzzification methods we used include Smallest of Maxima (SOM), in which the defuzzified value is taken as the element with the lowest membership values. Middle of Maxima (MOM), in which the defuzzified value is taken as the element with the median membership values. Largest of Maxima (LOM), is the element with the largest amongst all membership values. Centroid defuzzification, which returns the center of area under the curve, and Bisector, which is the vertical line that divides the region into two sub-regions of equal area.
In Table 5, the values that are produced correspond to phoning. These values were analyzed in this scenario, where centroid and MOM yielded the most accurate result. In terms of the driving severity level produced, LOM and SOM underperformed as they only picked extreme cases which would create an overexaggerated crisp value: LOM produced a very   high value while SOM produced a very low value that did not match up to the severity levels seen in the weights and MFs. Table 6 presents similar results from the dataset; this time the defuzzification crisp values that best matched the weights were Centroid, Bisector and MOM. This test concluded that the distraction severity increases as the duration increases. Referring back to Table 4, we can deduce that the number of frames that are continuous will affect the next severity level -as seen in the pda column, these number are progressively higher, and when the action of that driver stops, the values decrease as the severity level becomes safer.   Table 7 shows the crisp value output for texting. The values were similar to phoning and talking; however, this activity had the most severe level, the most accurate defuzzification methods were Centroid, Bisector, and MOM.
The root mean square from the dataset of the timeframes 1-47 were calculated and driver distraction severity level was measured upon calculating the Root Mean Square Error (RMSE). The RSME was calculated using the previous distraction severity used as the model: where da,i is a predicted value of the driver's activity, pda ,i is the previous driver activity (referring to Tables 5-7), and n is the number of data. From the observed timeframes, the predicted value from the output defuzzification method was Centroid, as it provided the most accurate reading of the weights assigned to the rules. Table 8 reports the results of the RMSE value to have achieved the most accurate error prediction of the previous severity frame and present severity frame. The comparison between Sugeno and Mamdani suggests that the Mamdani approach performed better in this context in terms of restrictive rules, complexity, modelling structure and accuracy. A clear advantage Mamdani has over Sugeno is that not all possible rule combination is required to construct the fuzzy rule base. Thus, Mamdani has ability to relate inputs and outputs in a non-linear manner through instances of sharp transitions through from distraction severity ranging from high to low and low to high value which is captured by the fuzzy membership functions. The actual outcome is to change from semi-autonomous take over from the driver when a certain threshold is reached. VOLUME 8, 2020 On the other hand, unsupervised learning using classification techniques by using set of rules may be applied to profile driver according to severity level. The methods for classification develop rules by discovering patterns in previous driver's data or possible prediction of the driver's distraction especially when the driver has to be monitored and profiled over a period of driving. Furthermore, a possible combination of a Hybrid Fuzzy-Deep learning techniques such as Convolutional Neural Network (CNN) will be adopted subsequently.

VI. CONCLUSION
This paper presents an evaluation method based on fuzzy set theory, focusing on driver distractions. We describe a rule-based fuzzy system deduced from an NDS dataset with multi-class distraction detected in the sequence of each image. The combination of driver activity, face orientation, hand state and previous drivers activity was used to compute the severity level of the multi-class distraction. The inference systems we designed classified the severity of a multi-class distraction using metrics such as distraction type, duration, and frequency of the activities. The results show that our fuzzy logic inference system was able to detect and classify multi-class driver distractions into safe, careless, and dangerous driving. Such as approach could be integrated into ADAS to reduce impact or mitigate driving distraction. Interestingly, the literature shows that driver activities such as texting and talking on the phone are dangerous and more serious than careless driving. However, our findings show that in a multi-class context, talking to a passenger and face orientation off the road is almost as dangerous as texting and face orientation off the road. This is due to the fact that it is common for a driver who is talking to passenger to have their face orientation off the road. This results in a similar degree of distraction when the driver is either talking to a passenger or texting. Finally, this research can be used to determine the threshold for transitioning control from the driver to a level 4 semi-autonomous vehicle. In future work, we will use a neural network for the classification of driver distractions. YING HE received the Ph.D. degree in computer science from the University of Glasgow, U.K. She is currently a Senior Lecturer of computer science with the School of Computing Engineering and Media (CEM), De Montfort University, U.K. Her current research interests include cyber threat intelligence, security risk management, decisionmaking, business analytics, control systems architecture, and human's aspects of security. She also works on how security management frameworks can be applied in different industries, such as healthcare and finance.
ALI H. AL-BAYATTI received the Ph.D. degree in computer science, in 2009. He worked at leading organizations, such as Deloitte, Airbus, Elektrobit Automotive, and Rolls-Royce, among others. He is currently an Associate Professor with De Montfort University. He is also the Subject Leader of cyber security with the Cyber Technology Institute. He is also a Visiting Professor at multiple institutes and a member of the Oman Research Council. He is one of the main factors behind a generated annual income of $1.3 Million at the Cyber Technology Institute. His current researches are multidisciplinary it include vehicular ad hoc networks, driver behavior, cyber security, and smart technologies that promote collective intelligence and its applications range from promoting comfort to enabling safety in critical scenarios. He serves on multiple Editorial Boards and, is on the Scientific Advisory Boards of multiple institutes in Gulf and Europe.
JARRAD NEIL MORDEN is currently pursuing the B.Sc. degree in computer games, math, and intelligent systems with the Faculty of Computing and Engineering, De Montfort university, U.K. His current research interests include cyber security, gamification of artificial intelligence in computer games, fuzzy logic, cyber security, and neural networks. ALHUSEEN OMAR ALSAYED received the master's degree in information technology from UTSFEIT, UTS Sydney, Australia. He is currently working as a Scientific Researcher at the Deanship of Scientific Research, King Abdulaziz University, Jeddah, Saudi Arabia He is also a certified Trainer and Professional Practitioner with KAU and Technical and Vocational Training Corporation, Saudi Arabia. His research areas of interests include E-learning, cloud-based E-learning, collaborative learning, social networking sites, and other related topics. He has published many articles in refereed/indexed international journals and conferences. VOLUME 8, 2020