Driver Distraction Detection and Early Prediction and avoidance of accidents using Convolutional Neural Networks

In this fast-moving world, accidents in four wheeled vehicles occur due to the break failure or because of the carelessness or the fatigue of the driver. The driver pattern of the driver plays a major role in providing road safety as well as in fuel consumption. The distraction of drivers is found by installing various sensors which is used for gathering real time data. The behaviour of drivers under stress condition and their behavioural patterns for early detection and avoidance of accidents are found using convolutional neural networks. Convolutional Neural Networks are efficient classifiers in handling image processing and computer vision problem. The input dataset is a collection of driving behaviour of 10 different drivers collected from Kaggle. The behaviour of drivers under 7 distracted situations like texting, talking through phone, playing music, drinking, eating, doing make up and talking to passenger are considered. The batch normalization is used at the right of the input layer in order to avoid skewing of data at a direction. It is shown, the convolutional neural networks at 4 epochs have shown 99% accuracy.


Introduction
According to World Health Organization, 1.24 million people die due to road accidents every year. The heart of any vehicle relies on the amount of assistance provided to the driver by the vehicle's support system. Autonomous cars provide technical solutions to tackle heavy traffic and congested locations in an efficient manner. Internet of Things (IoT) paves its way in this era in connecting various devices for intelligent data capture and processing. In this paper, we propose a novel method to gather data from four wheeled vehicles using sensors process them and alert the driver from the occurrence of accidents.

Literature Survey
Ahmed S. Shamsaldin et al (2019) has implemented a population-based algorithm named Donkey and Smuggler Optimization Algorithm (DSO). This optimization algorithm follows the concept of searching and selecting routes adopted by donkeys for transportation. Donkeys have the tendency to help each other. A donkey trying to cross a fence gets the support of another. This concept supports in obtaining the optimal solution. If the best solution is over loaded, then instead of chopping of this solution, the second-best solution can be adopted until the first solution becomes feasible to the situation.
For hybridization and improved optimization Whale optimization Algorithm (WAL) can be adopted Farhad Soleimanian Gharehchopogh and HojjatGholizadeh (2019). Fengfei Wang et al (2019) has proposed an improved kNN algorithm which reduce the dimension of the vector space and improves the precision and speed of classification performed with KNN.Jingzhao Li and ZihuaChen(2019) has developed a security information system for intelligent analysis using perception module based on CNN algorithm for coal mine safety inspection. Wrapper and Embedded are the various Feature Selection methods, Girish Chandrashekar and FeratSahin (2014). Filter methods adopt ranking methods such as Pearson correlation coefficient which can detect linear dependencies among obtained and target defined as defined in eqn.(1).

……………….(1)
Mutual information (MI) is another filter method, in which Information theoretic ranking criteria named shannon's entropy is defined. It can measure the dependency between two variables and is defined in eqn (2).

……………..(2)
From eqn. (2) b is the base of the logarithm used. By observing the variable X, the uncertainty in the output is reduced. The time complexity for measuring uncertainty, distances, consistency or dependency is less expensive than the accuracy of a learning process. The wrapper method for feature selection can be classified as Sequential Selection Algorithms and Heuristic Search Algorithms. with Ant Colony Optimization (ACO). It is proved that ALNS based algorithms are adoptive to the changing circumstances. XingsiXue and Junfeng Chen (2019) has adopted meta-heuristic Tabu search algorithm  (2018) has studied the attacks on networks using coordinated scan algorithm. The overall characteristic of the algorithm is studied by considering the scan sequence as a time series.

System Architecture
Studies on driver behavior depend upon simulators or based on data collected from multiple sensors. The car is equipped with GPS, accelerometer, gyroscope and magnetometer. The purpose of these sensors is to monitor real time data. The system for modeling the system is depicted in Fig.1. The pitch angles are received using sensor fusion and X-axis of the Accelerometer. Lane turn or change is recorded using yaw angles and Y-angles of the accelerometer. The location and speed limit is obtained through GPS. Harsh brakes are observed if brake is applied to more than 20 mph within 2 sec.
The GPS provide information to the sensor regarding the latitude, longitude value, max speed allowed, traffic details, etc. The data collected by the sensors are converted to normalized world coordinates. This conversion is mandatory in order to obtain device coordinates inside the vehicle. Converted sensor data is then pre-processed. The attributes best suited for prediction are obtained using Convolutional neural networks.

Convolutional Neural Networks
Raw sensor data records the values of 3 axes and time stamp, which indicates the time of data collection. The sensor data cannot be passed to the classifier, as it may contain missing data. A sliding window with the sensor data is hence sliced to a time frame of one-second in order to create the attributes required for classification. The process continues as the first frame is send across sliding window. A feature vector represents the details of sliding window collected from sensor data as depicted in Fig. 2   Data extracted from the sliding window is passed into the Convolutional layers, which are then passed through the pooling layer. Multiple levels of Convolutional layers are used for feature extraction, which ignores the noise present in the data collected through the sliding window. The output layer is used to obtain class probability distribution for identification of driver behaviour. The Convolutional layer and the pooling layer initiate Convolutional operations on sliding window sensor data. Each class of outputs produced by the Convolutional layer termed as feature map records the extracted features. The number of feature map obtained from the (l-1) of the Convolutional layer is nl-1 having the feature map size as defined in equation 3.
ml-1 = wl-1 * hl-1 ……………(3) The total number of neurons in the layer (l-1) is defined in eqn (4) and the feature map k from the output layer l of the Convolutional layer is defined in eqn. (5). nl-1 = nl-1 * ml-1 ………… (4) ---------- (5) where σ indicates ReLU activation function W (i,k,p) and indicates 2D filter mapping from p th feature map on the l-1 th layer to the k th feature map of the l th layer.The convolutional neural network with ReLU activation function could extract the essential features through the feature map whereby avoiding over-fitting. The output of pooling layer is obtained from eqn (6).

Results and Discussion
Installation of cameras and sensors inside vehicles has helped us in observing driver behaviour in a accurate manner. Data is a collection of 10 different states of drivers with one safe driving mode and 9 distracted driving modes. The dataset is taken from the state farm obtained through Kaggle. Data extraction and pre-processing is obtained by 9 categories. C0 indicates safe driving, c1: texting -right, c2: talking on the phone -right, c3: texting -left, c4: talking on the phone -left, c5: operating the radio, c6: drinking,c7: reaching behind,c8: hair and makeup and c9: talking to passenger. A sample of 4 images taken from different distractions is depicted in Fig.4. The batch normalization is provided at the input layer to avoid any input values. The output with softmax layer for 10 classes is studied with 4 epochs as shown in table 1. The validation from linear model has produced 94% accuracy whereas CNN with 4 epochs has produced 99% accuracy.

Conclusion
The performance comparison of our model with linear model and CNN is studied and by using the ReLU activation function in a CNN model has produced 99% accuracy. The proposed framework can learn features from the given dataset without much of preprocessing. Driver monitoring and analysis is the process of automatically extracting driver's data (eg., latitude, longitude, speed, acceleration, etc) and computes safety score. The live extraction of driver score can be obtained from sensor data instead of obtaining data from synthetic datasets.