## 4 Proposed Work
### Cluster-Based Vehicle Motion Detection
The target value is computed for each update by utilizing present approximation, which can be expressed as follows. \[x=q^{\prime}+\zeta C_{\phi}^{\pi}\left(\zeta^{\prime\prime}\right) \tag{19}\]

The pseudo code for the proposed A3C Algorithm is presented below, in which the working process for a single step is explained in a brief manner. ```
\(C_{\phi}^{\ast}-\textbf{{critc}}\textbf{{network}},\ \pi\theta-\textbf{{actor}}\textbf{{network}},\ \eta-\textbf{{critic}}\textbf{{scaling}}\textbf{{loss}},\ \beta-\textbf{{batch}}\textbf{{size}}\), SGD optimizer Randomly initialize \(\phi,\theta\);  Utilize \(\pi(\theta)\) to obtain roll-out size of \(\beta\);  Advantage estimation is computed for each transition (\(\textbf{{tr}}\)) using Equation (17) Target formulation using Equation (19)  Critic loss calculation: \[L=\frac{1}{b}\sum_{\textbf{{tr}}}\left(x(\textbf{{tr}})-C_{\phi}^{\pi}\right)^{2}\]  Critic gradient computation: \[\
abla^{\textit{critic}}=\frac{3t}{\delta\phi}\] Actor gradient computation: \[\
abla^{\textit{actor}}=\frac{1}{b}\sum_{\textbf{{tr}}}\
abla_{\theta} log\pi_{\theta}(\forall|\xi)AD^{\pi}(\textbf{{tr}})\] Calculate gradient descent using \[\
abla^{\textit{actor}}+\eta\
abla^{\textit{critic}}\]
```

**Algorithm A3C:** Pseudo code

Table 2 represents the normal range of input parameters for the purpose of driver behavior analysis and detection, which are used to classify the current state of the driver. For instance, if the EEG rate of the driver is below 8 Hz, then the driver is found to be in drowsy state; a variation in the physiological features of the driver results in an emergency state being detected, the state of distraction is detected with the help of a camera installed inside the vehicle. Speeding is detected from vehicle speed with respect to traffic conditions. Bad pedaling refers to improper usage of the accelerator and brakes, which can be detected from the angle measured from the yaw angle rate. Likewise, these parameters contribute to the detection of the driver's current state. Driver behavior is analyzed in a periodical manner having a small interval of time. Figure 3 depicts the working of the A3C algorithm for the purpose of analyzing driver behavior. The states are given as input to the A3C algorithm to provide output with six types of classes in which drowsiness occurs due to continuous driving for a long period. Drivers are distracted due to abnormal activities or any events (i.e., accidents) occurs on the road. Partial conscious driving results in speeding, bad steering, and bad pedaling. Emergency situations are identified based on speed and steering behavior. \begin{table}
\begin{tabular}{c c c} \hline \hline
**Feature Type** & **Feature Name** & **Range** \\ \hline Physiological & Pulse rate & 50–110 (ppm) \\  & EEG rate & 8–13 Hz \\  & Respiratory rate & 12–20 (ppm) \\  & Rhythm & Yes \\  & Q wave & 0.15 \\  & ST elevation & 0.13 \\  & ST depression & 0.16 \\ Vehicular & Speed & 40–80 km \\  & Longitudinal acceleration & 0.1–0.22 m/s\({}^{2}\) \\  & Yaw angle rate & 20\({}^{7}\)/s\({}^{-}\)27\({}^{7}\)/s \\  & Position & (Latitude, Longitude) \\  & Moving direction & (North, South) \\ Environmental & Traffic density & 15 vehicles/Km \\  & Accidents & 4 incidents till now \\  & Weather condition & Sunny \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Input Parameters. ### Alert Message Dissemination for Selective Regions

The decision to disseminate alert messages is based on the current state of the driver, which is analyzed as the driver behavior [45]. The messages are disseminated to relay vehicles by implementing the JSO Algorithm on the variation in the normal range of longitudinal acceleration. Bad steering refers to inappropriate usage of steering, which is detected by sudden changes in the orientation of the basis of mobility, moving direction, and mutual distance. For all selected vehicles, a fog node sends an alert message to protect the environment.