## 4 Framework Development and Validation
### Lane Identification Algorithm Development
Randomly crop image and rescale bounding boxes
20. else if augmentation is CLAHE then
21. Apply Contrast Limited Adaptive Histogram Equalization
22. else if augmentation is grayscale then
23. Convert image to grayscale
24. end if
25. end for
26. return augmented images and labels end function
```  
**Algorithm 1** Data Augmentation Algorithm  
After the training image dataset was constructed, the lane identification algorithm based on YOLOv5 was designed with the structure shown in Figure 7. The algorithm follows a sequential process from input to output. Although more recent versions such as YOLOv10 offer architectural improvements, YOLOv5 was selected for this study due to its proven training stability and effective performance on small-scale datasets, which match the characteristics of our data. In the input stage, the trained images are fed into the model. In the backbone stage, the model generates an optimal weight file (best weight file) through training while simultaneously evaluating performance metrics such as the confusion matrix, recall, precision,  
Figure 7: Structure of the lane identification algorithm (YOLOv5). and object and class loss. In the neck stage, the verified best weight file is used to assess the lane detection accuracy on new images. The head stage utilizes the outputs from the neck to detect the type and location of lanes. Finally, in the output stage, the model produces the lane identification results, including lane classes and positional information. The performance of object detection using the YOLOv5 algorithm was evaluated using standard metrics, including precision, recall, mean average precision (mAP), and intersection over union (IoU). Precision, as defined in Equation (1), measures the proportion of correctly predicted positive instances among all instances predicted as positive. Recall (Equation (2)) refers to the proportion of actual positive instances that were correctly identified by the model. The mean average precision, or mAP, defined in Equation (3) is the average of precision values across all levels of recall and is commonly interpreted as the area under the precision-recall curve. Finally, the model applies non-maximum suppression (NMS) based on intersection over union (IoU) to select the most accurate bounding box predictions. IoU, shown in Equation (4), quantifies the degree of overlap between the predicted bounding box and the ground truth. \[\textit{Precision}=\frac{\textit{True\,Positives}(\textit{TP})}{\textit{True \,Positives}(\textit{TP})+\textit{False\,Positives}(\textit{FP})} \tag{1}\]  
\[\textit{Recall}=\frac{\textit{True\,Positives}(\textit{TP})}{\textit{True \,Positives}(\textit{TP})+\textit{False\,Negatives}(\textit{FN})} \tag{2}\]  
\[\textit{AP}=\int_{0}^{1}\textit{Precision}(\textit{Recall})\textit{d}( \textit{Recall}),\,\,\textit{mAP}=\frac{1}{N}\sum_{i=1}^{N}\textit{AP}_{i} \tag{3}\]  
\[\textit{IOU}=\frac{\textit{Detected\,\,area}\,\,\cap\,\,\textit{Actual\,\, area}}{\textit{Detected\,\,area}\,\,\cup\,\,\textit{Actual\,\,area}}\times 100 \tag{4}\]  
Training was conducted in a high-performance computing environment equipped with a 13 th-generation Intel(r) Core(tm) i9-13900 HK processor and an NVIDIA GeForce RTX 4080 GPU. The dataset was divided into 80% for training and 20% for validation. The XL model was trained for 100 epochs, with the confidence threshold set at 0.4 and the IoU threshold at 0.45. The batch size was set to 16 and the learning rate to 0.01, optimized using the SGD optimizer. Additionally, data augmentation techniques based on Mosaic and HSV transformations were applied to improve the model's generalization performance. According to the confusion matrix analysis shown in Figure 8, object recognition accuracy ranged from 93% to 100%. Both object and class loss rates were low, and the model achieved a mean average precision (mAP) of 97.4%, a precision of 98.3%, and a recall of 94.0%, demonstrating excellent performance.