## 2 Method  
### Basic Principles of the YOLOv5 Algorithm  
The YOLOv5 algorithm is a representative neural network in the field of deep learning. It belongs to one-stage detection algorithms, which accomplish both object recognition and classification. In one-stage algorithms, the input dataset images are passed through only one network for feature extraction. Anchor frames are used in the last layer for prediction, and the result generated contains both location and category information. In contrast, two-stage detection algorithms requires first generating candidate frames. Based on the candidate frames, the corresponding features are extracted, and a classifier is used to classify the target for each candidate frame. Finally, based on this, bounding box regression is performed on the candidate boxes to determine the target location. Compared to two-stage algorithms, one-stage algorithms have lower accuracy but require less computation, resulting in faster processing speed. Lane line classification is part of the perception module in ADAS, which demands real-time capability. Taking these factors into consideration, the YOLOv5 algorithm is selected for lane line classification.  
The YOLOv5 algorithm has four versions: YOLOv5s, YOLOv5m, YOLOv5l, and YOLOv5x, based on different model depths and feature map widths. Among them, YOLOv5s has the smallest model depth and feature map width among all versions, followed by YOLOv5m, YOLOv5l, and YOLOv5x. Specific data are shown in Table 1. As the model size increases, the recognition accuracy gradually improves, but the inference speed decreases. According to different tasks and requirements, you can choose the appropriate version to use. For tasks requiring high detection speed, choose YOLOv5s or YOLOv5m. For tasks requiring high accuracy, choose YOLOv5l or YOLOv5x. Considering the real-time requirements of ADAS, this paper selects the YOLOv5s algorithm as the network model for lane line classification.  
YOLOv5s consists of the input, backbone network, neck network, and head output, as shown in Figure 1. The input is augmented with mosaic data, adaptive anchor frame computation, and adaptive image scaling. Its main role is to pre-process the dataset images to improve the accuracy and generalisation of the model. The backbone network contains a network of classifiers with good performance, including the C3 module, the CBL module, and the spatial pyramid pooling (SPP) module. It is mainly used to extract feature information from the input image for subsequent object detection tasks. The neck network adopts the FPN [29] + PAN [30] structure. It can enhance the multi-scale semantic representation and localisation ability of the model, and further improve the diversity and robustness of image features. The header output layer is responsible for generating the final object recognition result. This part applies multi-level feature fusion and loss function to improve the detection performance of the model.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Model** & **Depth Multiple** & **Width Multiple** \\ \hline YOLOv5s & 0.33 & 0.50 \\ YOLOv5m & 0.67 & 0.75 \\ YOLOv5l & 1.00 & 1.00 \\ YOLOv5x & 1.33 & 1.25 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Parameters of different YOLOv5 versions.