## 5 Traffic Hazard Prediction Model
### Simulation Assumptions  
The model itself must also be evaluated using appropriate metrics. Evaluation metrics such as AUC (Area Under the Curve), F1-score, and Recall are key tools in assessing the effectiveness of predictive models, especially in road safety applications. AUC, which measures the area under the ROC (Receiver Operating Characteristic), assesses the model's overall ability to distinguish between risk classes (e.g., no risk vs. high risk). This is important in identifying areas with varying accident risks. A high AUC value (>0.8) would indicate good separation between safe and risky situations, which could support decisions on resource allocation, such as police patrols. The F1-score, which is a harmonic mean of precision and sensitivity, allows the balance between correctly detecting real threats and minimizing false alarms to be assessed. This is crucial in speed control systems, where an excessive number of warnings could reduce driver confidence. Recall (sensitivity), on the other hand, measures the model's ability to detect all high-risk cases, such as extreme speed violations. These violations, although rare, have a significantly high impact on safety. Even without model implementation at the conceptual stage, these metrics are essential because they enable future evaluation of hazard prediction effectiveness. This could lead to more precise preventive interventions, such as dynamically adjusting speed limits in high-risk areas based on synthetic data from SUMO. The presented model concludes with a softmax layer, defined as \(\mathrm{y(t,s)}\)\(=\mathrm{softmax}(\mathrm{W_{y}h_{t}+b_{y}})\), where \(\mathrm{h_{t}}\) is the hidden state of the LSTM, and softmax transforms the logit vector into probabilities of belonging to risk classes \(\sum y(t,s)=1\). These \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Type of Data** & \multicolumn{1}{c}{**Data Details**} & **Data Source** & **Difficulty of Obtaining** \\ \hline Weather data & \(\bullet\) & Temperature (\({}^{\circ}\)C) & \\ Weather data & \(\bullet\) & Precipitation (mm/h) & \\ \(\bullet\) & Type of precipitation (rain, snow, and none) & \(\bullet\) & Weather stations, \\ \(\bullet\) & Fog (visibility in meters) & database of meteorological & Low \\ \(\bullet\) & Wind force (km/h) & archival data & \\ Surface conditions & (dry, wet, and icy) & \\ \(\bullet\) & The exact geographic & \\ coordinates of the & & & \\ sensor locations & \(\bullet\) & Road classification (highway, \\ national road, local road, and residential zone) & \(\bullet\) & OpenStreetMap \\ Location and road infrastructure data & \(\bullet\) & Permissible maximum speed & \(\bullet\) & Road manager reports \\ \(\bullet\) & The distance to the nearest & local inspections. \\  & security-sensitive points & & \\  & (schools, kindergartens stores, \\  & and hospitals) & & \\  & The presence of road infrastructure & & \\  & (speed bumps, traffic lights, and \\  & pedestrian crossings) & & \\  & \(\bullet\) & The number and exact locations & \\  & of historical accidents & \\  & or collisions & & \\ Historical data on & \(\bullet\) & Types of incidents (pedestrian \\ accidents and incidents & hit-and-run, vehicle collision, \\  & and fatal accident) & & \\  & The causes of accidents (speed, \\  & inattention, and weather conditions) & & \\ \hline \hline \end{tabular}
\end{table} 
Table 1: _Cont._probabilities are used for binary or multi-class classification, based on which metrics are calculated. The AUC metric measures the model's ability to distinguish between risk classes, such as high and low. It could be calculated based on the ROC curve, where the axes are sensitivity (Recall) and specificity. In the context of the presented model, AUC would assess how well softmax separates classes based on inputs such as speed \(\
u(t,s)\) or weather conditions \(w(t,s)\). This is crucial for road safety to avoid false negatives in accident prediction.