# Internet of Things (IoT)-Based Solutions for Uneven Roads and Balanced Vehicle Systems Using YOLOv8
## 4 Dataset and Preprocessing
### Dataset Label Taxonomy and Configuration
Figure 12: Precision-Recall, F1, and mAP Curves Across All Classes. #### 5.5.4 F1 vs. Confidence

Figure 14 highlights the confidence level at which each class achieves optimal F1-score. This balance between precision and recall allows practitioners to tune the model based on specific road anomaly detection requirements, such as prioritizing safety or maintenance urgency. ### Error Analysis

#### 5.6.1 Confusion Matrix

Figure 15 shows the unnormalized confusion matrix, detailing the raw misclassification counts per class. Misclassification patterns reveal inter-class similarities, such as confusion between \"Medium Pothole\" and \"Low Ravelling\" due to subtle visual overlap. This analysis provides a foundation for exploring enhanced discriminative features or multi-modal extensions in future work. Figure 14: F1 Score vs. Confidence Threshold per Class. Figure 13: Precision vs. Confidence Threshold Curve. #### 5.6.2 Normalized Confusion Matrix

Figure 16 presents the normalized confusion matrix, where each row is scaled to 1. This view emphasizes per-class classification accuracy while accounting for label imbalance. The normalization ensures fair comparison across dominant and minority classes and supports transparency in model robustness reporting. ### Precision-Confidence Curve (Class-Specific)

Figure 17 illustrates precision trends for individual anomaly classes--such as pot-holes (green), bumps (orange), and road damage (blue)--at varying confidence thresholds. The bold aggregate curve represents average model performance, achieving a peak precision of 0.99 at confidence 1.0. This confirms YOLOv8's reliability in identifying high

Figure 16: Normalized Confusion Matrix: Class-wise Accuracy Proportions. Figure 15: Raw Confusion Matrix: Misclassifications Across All Classes. severity anomalies while enabling threshold tuning to reduce false alarms in low-severity or ambiguous cases. ### Multi-Class Performance with YOLOv8

The YOLOv8 model was trained on a fine-grained, nine-class dataset encompassing multiple road anomaly types and severity levels. Unlike traditional binary or ternary detection systems, our architecture enables fine-resolution classification that can differentiate between low, medium, and high-priority road issues. Performance evaluation highlights strong precision, recall, and mAP scores across all classes--despite intra-class visual similarities. Confusion matrices and score distributions confirm the model's capacity to generalize across challenging examples and underrepresented terrain conditions. This multi-class capability unlocks actionable insights: for example, municipalities may automate maintenance prioritization by triggering alerts for high-severity pot-holes while deferring minor edge cracking. This approach supports scalable, data-driven infrastructure monitoring guided by real-time detection and classification on edge-enabled platforms. Table 14 presents the performance metrics of the YOLOv8 model used for detecting road surface anomalies. We conducted the evaluation using a confidence threshold of 1.00. The model has a high precision of 0.99, indicating strong accuracy in correctly identifying anomalies. The recall value of 0.86 reflects its ability to detect the majority of true anomalies. The mean average precision at the IoU threshold of 0.5 ([EMAIL_ADDRESS]) was 0.50, representing moderate localization performance. The model's average inference time was 27 ms per frame, supporting its suitability for real-time edge development. \begin{table}
\begin{tabular}{l c} \hline \hline
**Metric** & **Value** \\ \hline Precision & 0.99 \\ Recall & 0.86 \\ [EMAIL_ADDRESS] & 0.50 \\ Threshold & 1.00 \\ Inference Time & 27 ms \\ \hline \hline \end{tabular}
\end{table} 
Table 14: Performance summary of YOLOv8 model. Figure 17: Per-Class Precision–Confidence Curves.