# In-Vehicle Data for Predicting Road Conditions and Driving Style Using Machine Learning
###### Abstract  
Many network protocols such as Controller Area Network (CAN) and Ethernet are used in the automotive industry to allow vehicle modules to communicate efficiently. These networks carry rich data from the different vehicle systems, such as the engine, transmission, brake, etc. This in-vehicle data can be used with machine learning algorithms to predict valuable information about the vehicle and roads. In this work, a low-cost machine learning system that uses in-vehicle data is proposed to solve three categorization problems; road surface conditions, road traffic conditions and driving style. Random forests, decision trees and support vector machine algorithms were evaluated to predict road conditions and driving style from labeled CAN data. These algorithms were used to classify road surface condition as smooth, even or full of holes. They were also used to classify road traffic conditions as low, normal or high, and the driving style was classified as normal or aggressive. Detection results were presented and analyzed. The random forests algorithm showed the highest detection accuracy results with an overall accuracy score between 92% and 95%.  
machine learning; decision trees; random forests; SVM; supervised machine learning; road conditions prediction; driving style prediction; in-vehicle data; CAN +
Footnote †: journal: _aciences_  
review for connected vehicles data and Internet of Things (IOT) to implement the smart cities approach can be found in [10].  
Connected vehicles data systems require wireless devices to transfer the data. Moreover, the size of the transferred data is large and the data require advanced data storage and data processing systems. The ML approaches required to deal with the connected vehicles data are more complex than in-vehicle data. Therefore, in-vehicle data systems are usually less expensive and more readily available than connected vehicles data-based systems.  
The main goal of this research is to enhance vehicle and road safety using a low-cost ML system that uses readily available in-vehicle data. Two design considerations were taken into account to reduce the ML system cost. The first consideration is that the ML system requires only basic in-vehicle CAN data. No special sensors, such as cameras and radars, are required by the ML system. Engine rpm, engine coolant temperature, manifold pressure, vehicle acceleration and fuel consumption are examples of the used data by the ML system. These data are available in the CAN for the main vehicle functionalities, and the proposed ML system uses this existing for predicting road conditions. This will significantly lower the cost of the data required by the ML system.  
The second consideration is to use traditional ML algorithms, such as decision trees, random forests and SVM. These algorithms can achieve acceptable accuracy scores and allow real-time implementation with low cost. Deep learning algorithms may provide more accurate predictions than the traditional ML algorithms, but also require very expensive systems for real time implementation.  
The proposed ML system handles three categorization problems; road surface conditions, road traffic conditions and the driving style. Road surface is characterized by three classes; full of holes, smooth or even. Road traffic is characterized as high, normal or low and the driving style is characterized as aggressive or normal.  
In this paper, Section 2 explores some related work to our research. Section 3 provides an overview of the proposed system architecture. Section 4 explains the dataset we used for algorithms training and testing. Section 5 briefly explains the ML algorithms implementation. Section 6 defines the evaluation metrics. Section 7 presents the detection results. Section 8 provides a discussion about the system results, system limitation and future enhancement. Finally, conclusions are provided in Section 9.