## 2 YOLOv8 Network  
The object detection networks based on deep learning are classified into two categories: single-stage and two-stage methods. Single-stage methods aim to directly predict the classification and localization of objects through a convolutional neural network, such as YOLO, SSD [19], and Retina-Net [34]. On the other hand, two-stage methods consist of two networks. The input image first generates region proposals through a region proposal network and then predicts the classification and location of the objects using a convolutional neural network, such as SPPNet [35], Faster R-CNN [12], and Mask R-CNN [13]. Since the single-stage methods significantly simplify the training process, reduce the number of model parameters, and improve the inference speed compared to two-stage methods, the single-stage methods are commonly used in mobile devices. The YOLOv8 [18] method, developed by Ultralytics, is a single-stage neural network algorithm for object detection, image classification, and instance segmentation tasks. It consists of four main components: input preprocessing, backbone network, neck network, and detection head layer. When compared to YOLOv5 [15], which is also developed by Ultralytics, YOLOv8 includes numerous architectural and developer experience enhancements and modifications. The architecture of YOLOv8 is depicted in Figure 1.  
The input preprocessing mainly includes image size processing, random scaling, rotation, cropping, mosaic, and other data enhancements so that the expanded training data is as close as possible to the actual distribution data, preventing the model from learning target-irrelevant information and reducing the overfitting problem caused by sample imbalance, thereby improving the prediction accuracy and robustness of the model. The backbone network mainly comprises the Conv, C2f, and SPPF modules. Among them, the Conv convolution module consists of three modules: Conv2D, BatchNorm, and SiLU; SPPF is an improvement on SPP in that it uses three \(5\times 5\) max-pooling layer cascades to replace the original \(5\times 5\), \(9\times 9\), and \(13\times 13\) max-pooling layer, thereby further improving the inference speed while achieving fusion of the same size receptive field; the C2f module is designed concerning the ideas of the C3 and ELAN modules, as shown in Figure 2, each network layer can obtain richer gradient flow information with the help of C3's gradient shunt and residual structure, combined with more parallel gradient flow branch structures in ELAN. Figure 1: A structure diagram of the YOLOv8 network, mainly consisting of a Conv module, C2f module, SPPF module, and a Detect module. The neck network uses a top-down FPN (feature pyramid network) combined with a bottom-up PAN (path aggregation network) structure to form a feature pyramid structure, which reduces the transmission path from low-level features to high-level features; it also enables the fusion of feature information of different sizes and better uses low-level feature information to predict results. In the detection head layer, YOLOv8 introduces the decoupled head mechanism. The traditional coupled head aims to directly predict the category and position through the convolutional layer output features of the neck network. In contrast, the decoupling head uses the output features of the neck network to predict the category and location through different network branches. The difference between the coupled head and the decoupled head is shown in Figure 3. Although using a decoupling head will bring a little extra parameter and computational cost, separating regression and classification tasks can speed up model convergence and improve network accuracy. Figure 3: Comparison of Coupled Head and Decoupled Head module. The Decoupled Head uses different branches to process the feature map separately to predict the category and location. In contrast, the Coupled Head does not process it separately to predict the category and location simultaneously. Figure 2: Comparison of C3, ELAN, and C2f modules.