## 3 Algorithm Improvement  
### YOLOv8 Network Model  
YOLOv8 is the latest version of the object detection and image segmentation model developed by Ultralytics in 2023. Building upon the successful foundation of YOLOv5, YOLOv8 introduces new functionalities and improvements aimed at further enhancing performance and flexibility. The YOLOv8 algorithm has developed five distinct models, denoted as YOLOv8n, YOLOv8s, YOLOv8m, YOLOv8l, and YOLOv8x, each with varying sub-module depths and widths. The model detection accuracy and model size have been improved in sequence. Considering the limited hardware resources and the high real-time requirements in actual coal mine underground environments, strict limitations on the model size are necessary. Therefore, in this study, we selected YOLOv8n, which has the minimum parameters and model computation, as the experimental model in coal mine belt conveyors. Its architecture is illustrated in Figure 3.  
The YOLOv8 network comprises input, backbone, neck, and head components. At the input stage, primary operations include mosaic augmentation, adaptive anchor box calculation, and responsibility for receiving image data to pass it to the next layer of the network. Typically, the YOLOv8 network divides the image into fixed-sized grids and utilizes the information from each grid for object detection. The backbone serves as the network's central component, responsible for transforming input images into feature maps that contain both object positions and feature information. Typically, the backbone network consists of convolutional layers, pooling layers, and other deep learning layers, enabling it to capture information from different abstraction levels in the image. In YOLOv8, the Context to Focus (C2F) module has been introduced to replace the Cross Stage (C3) module, incorporating additional skip connections to enhance the model's gradient flow and strengthen the network's feature representation capacity. Figure 2: Partial foreign object data image. (**a**) The original images; (**b**) preprocessed images. The neck layer is employed to further extract and integrate features from the backbone network, typically consisting of a series of convolutional and pooling layers. Its role is to enhance feature representation and aid the network in better understanding contextual information about objects. In YOLOv8, the neck layer adopts the Path Aggregation Network (PANet) structure, which strengthens the network's ability to aggregate object features at different scales. The head layer serves as the network's output component and is responsible for generating object detection results. Its primary function is to map the feature maps to object detection results to determine the position and category of detected objects. Typically, the head includes convolutional and detection layers. In YOLOv8, the classification and regression tasks are predicted separately, with the classification task still employing Binary Cross-Entropy Loss (BCE Loss), while the regression task utilizes Distribution Focal Loss (DFL Loss) and Complete Intersection over Union Loss (CIOU Loss) functions. These loss functions enable the network to rapidly focus on the distribution of positions in the vicinity of the target location, resulting in integer coordinate weight values. Floating Point Operations (FLOPs), Memory Access Cost (MAC), parallelism, and computing platforms are important metrics for assessing network models' computational speed and complexity. FLOPs quantify the amount of floating-point computations, i.e., the computational workload of the network model. Under a given MAC, parallelism, and computing platform, the larger the FLOPs, the greater the computational workload and complexity of the model. Although the YOLOv8n network exhibits good performance in object recognition accuracy and detection speed, the complex underground environment in coal mines (characterized by humidity, high coal dust levels, insufficient lighting, and  
Figure 3: YOLOv8 network structure diagram.