## 1 Introduction  
In recent years, the rapid development of intelligent transportation systems (ITS) and the Internet of things (IoT) has contributed a lot to a fast-emerging technology called \"Internet of connected vehicles\" (IoCV) [1]. Vehicles are connected with each other and with road infrastructure for better transportation and to avoid complications from traffic congestion and road accidents. Car crashes, head-on accidents, fires, and roll-on events can be accurately detected with the assistance of on-board sensors that are deployed in intelligent vehicles [2]. In the broad field of accident prevention and road safety, driver behavior analysis is prominent since a large number of accidents occur due to a lack of attention by drivers [3, 4]. In the analysis of driver behavior, it is also necessary to consider traffic and junction characteristics to increase accuracy [5]. Edge-assisted road side units (E-RSUs) play a vital role in monitoring vehicles [6]. Recently, 5G wireless networks have permitted researchers to cover an enormous number of vehicles to collect real-time data and then analyze the behavior of the drivers [7]. Additionally, current smart systems use alert generation modules in monitoring systems to send immediate alerts to corresponding vehicles [8]. When we look back at the research work on driver behavior, the researchers usually followed the practice of analyzing past events collected from both vehicular and infrastructure communication systems and evaluating the data to compute a safety score for drivers [9]. Moreover, a minimal number of research papers have focused on personalized recommendations for corresponding behaviors of drivers [10]. However, intelligent recommendations are still made on-demand to the driver on the basis of actions the driver makes [11]. To make such recommendations, vehicles, road side infrastructure, and smart wearable devices and sensors worn by drivers must be used to collect information on each individual vehicle's driver [12]. Another main challenge with connected vehicles is the computation of data; vehicles are often not efficient at computing data and thereby offload the task to the cloud [13]. These computations have to be performed at an ultra-low latency. The conventional cloud computing technique cannot be used as it involves transmission delay, and this might cause delayed decisions, which would result in congestion, traffic delays, and accidents [14]. To overcome delays, the computation process has to be distributed to a number of fog nodes in a decentralized manner [15]. These fog nodes are responsible for computing the data for separate regions and sending only the result to the cloud to meet reliability challenges [16]. A fog node has a processing ability higher than that of E-RSUs. Current advancements in artificial intelligence (AI) such as machine learning, deep learning, and deep-reinforcement learning support massive real-time data processing and decision making [17]. The clustering of vehicles in a network reduces complexity, resulting in reduced time consumption [18]. The assistance provided to the driver should be generated dynamically as traffic increases [19]. The driver should be provided with prior assistance regarding lane changes in order to avoid risks [20; 21]. To explore more effective results, a specific choice of algorithm using AI is highly required. The major aim of this research is to reduce road casualties in an environment by connecting vehicles and by detecting driver behavior. Driver behavior is considered in order to provide intelligent driving assistance to the driver. An alert message is disseminated to the surrounding vehicles that are near a vehicle presenting risks. The behavior of the driver is detected and categorized into several classes so as to assist the driver precisely.