# Effects of Hybridizing the U-Net Neural Network in Traffic Lane Detection Process
## 2 Materials and Methods
### Simulation Conditions  
The robustness and efficiency of the hybrid U-Net model was tested by using a mixture of real and virtual data. The real data used images from the TuSimple database, and the virtual data were taken from the Carla virtual simulation environment (which allowed the integration of images from complex scenarios, both in terms of traffic and environmental conditions). A training session was performed that included only images generated by the Carla simulation environment (3890 labeled images), only images taken from the TuSimple database (3626 labeled images), and an equal mix of images from Carla (1750 labeled images) and TuSimple (1750 labeled images). A notable limitation of our current study is the lack of systematic categorization and performance analysis across specific environmental and road conditions within the Carla dataset. While our 3890 Carla-generated images encompassed diverse scenarios including urban environments, highways, suburban areas, and various weather conditions (day, night, rain, cloudy), we did not perform a systematic breakdown of model performance according to specific scene types (e.g., fog density levels, intersection complexity, highway vs. urban performance). The small number of data selected, and the hardware used were assumed by the authors, one of research directions being to be able to obtain superior results with reduced computational resources. For the comparative analysis of the hybrid U-Net model's performance, the following cases related to changes in the basic U-Net network were considered:  
* Basic U-Net;
* U-Net modified with GSC;
* U-Net modified with TE;
* U-Net modified with MDLSM;
* Hybrid U-Net. Figure 7: Spatial attention module structure. The analysis of the results was carried out taking into account four performance indicators (or quality parameters): mean intersection over union (mIoU), F1 accuracy score, inference time, and the number of frames processed per second (FPS). The mIoU parameter is a measure of the overlap between the predicted segmentation and the actual ground segmentation of the traffic lane (Equation (1)). It is calculated as the overlap area divided by the union area between the predicted and ground truth segments. It provides a single metric that summarizes the overall performance of the segmentation model:  
\[\text{mIoU}=\frac{\text{Intersection}}{\text{Union}} \tag{1}\]  
Another important parameter is the F1 score, a parameter that combines two factors, precision and recall (Equation (2)). The precision factor is defined as the fraction of detected lane pixels that are correct, and the recall factor represents the fraction of ground lane pixels that are detected:  
\[\text{F1}_{\text{score}}=2\cdot\frac{\text{Precision}\cdot\text{Recall}}{ \text{Precision}+\text{Recall}} \tag{2}\]  
The inference time (speed) is a critical performance parameter for real-time applications, since the implementation and architecture of a neural network on mobile devices has many stringent requirements regarding latency and computational resources [33]. The FPS parameter considered in the study measures how many frames can be processed per second and is an important factor in the development of ADAS systems. This is because another major challenge of incorporating an ADAS vision algorithm is running it in real time on the embedded hardware platform, and the frame rate of the overall driver assistance system is limited by the camera frame rate and the application processing time [34]. In order to quantify and compare the efficiency of the neural networks (hybrid U-Net vs. U-Net) in real time, the following notions were introduced: confidence and coverage. The confidence metric (Equation (3)) quantifies the average confidence of the neural network in classifying each pixel as belonging to a traffic lane, being expressed as the arithmetic mean of the probability values generated by the model.