# Internet of Things (IoT)-Based Solutions for Uneven Roads and Balanced Vehicle Systems Using YOLOv8
## 4 Dataset and Preprocessing
### Dataset Label Taxonomy and Configuration
The IoT-based live measurement interface (Figure 9) further reinforces system reliability, serving as a transparent interface for real-time verification and anomaly tracking. ### Baseline Comparison and Control Evaluation

To evaluate the effectiveness of the stabilization system, we benchmarked three control configurations under identical test conditions:

1. **No Stabilization (Baseline A):** Servo actuation disabled; system recorded tilt but performed no correction. 2. **Proportional Control Only (Baseline B):** Actuation based only on the proportional (P) term of the PID controller. 3. **Full PID + Sensor Fusion (Ours - Baseline C):** Real-time actuation using full PID logic and MPU6050 feedback. These results in Table 11 affirm the value of real-time PID-based correction and fusion-driven stabilization. Combined with the adaptive capabilities detailed in Section 3, the system forms a robust, deployment-ready framework for real-world vehicle balancing. ### Training Procedure

Figure 10 illustrates the model's learning process. YOLOv8's loss components (box, class, and objectness loss) decrease steadily, while performance metrics--mAP, precision, and recall--converge toward stable optima. This indicates successful generalization without overfitting. The alignment of validation and training curves supports the robustness of the training strategy and confirms reliable downstream evaluation. Table 12 outlines the key hyperparameters used during training. The selection was empirically optimized to balance model performance with convergence stability, especially for a high-resolution, multi-class detection task. \begin{table}
\begin{tabular}{l c c c} \hline \hline
**Stabilization Method** & **Avg. Tilt Reduction (\%)** & **Avg. Recovery Time (s)** & **Stabilization Success (\%)** \\ \hline No Stabilization & 12.4 & N/A & 0.0 \\ Proportional Control Only & 52.6 & 1.02 & 66.3 \\ Full PID + Sensor Fusion (Ours) & **82.7** & **0.38** & **92.5** \\ \hline \hline \end{tabular}
\end{table} 
Table 11: Control Baseline Comparison Across Stabilization Configurations. Figure 9: Blynk IoT Dashboard Telemetry Captured During Live Physical Tests. The Measurements Validate Obstacle Height Readings for Potholes and Bumps Detected by the System. ### Baseline Detection Comparison with Prior Methods

We benchmarked our YOLOv8 model against several established detection frameworks, including YOLOv5 [45], SSD [46], and Haar Cascade [47], using the same dataset and evaluation pipeline. Table 13 presents the detection performance in Precision, Recall, and F1-Score. ### Evaluation Metrics

#### 5.5.1 Confidence vs. Recall

Figure 11 visualizes how recall varies with changing confidence thresholds. High recall across thresholds indicates that the model detects most anomalies, even under strict confidence settings--critical for minimizing false negatives in road safety applications. \begin{table}
\begin{tabular}{l c c c} \hline \hline
**Model** & **Precision (\%)** & **Recall (\%)** & **F1 Score (\%)** \\ \hline YOLOv5 [45] & 87.1 & 85.9 & 76.0 \\ SSD [46] & 78.4 & 74.0 & 76.1 \\ Haar Cascade [47] & 63.5 & 59.0 & 61.1 \\
**YOLOvs (Ours)** & **99.0** & **86.0** & **80.0** \\ \hline \hline \end{tabular}
\end{table} 
Table 13: Baseline Detection Accuracy Comparison on Our Dataset. Figure 10: Training and Validation Loss with Converging Metrics. #### 5.5.2 Precision vs. Recall

Figure 12 presents the precision-recall (PR) curve and its derivatives. The consistently high area under each curve reflects strong reliability across all classes. These metrics collectively validate the model's ability to handle both frequent and less-represented road anomalies. #### 5.5.3 Precision vs. Confidence

Figure 13 helps identify ideal confidence thresholds that maintain high precision. This is particularly useful in real-time deployments, where system confidence must be balanced with acceptable false positive rates. The curve guides dynamic thresholding strategies or fallback logic activation. Figure 11: Recall vs. Confidence Threshold per Class and Aggregate.