# Old Landslide Detection Using Optical Remote Sensing Images Based on Improved YOLOv8
## 3 Method
### YOLOv8 Model  
The YOLOv8 model is a one-stage object detection model, which was proposed by Ultralytics in 2023 [27]. It is an improvement upon the YOLOv5 algorithm [26], featuring a more streamlined network structure with fewer parameters and higher detection precision. The basic code for the YOLOv8 algorithm can be obtained from the GitHub website at [[https://github.com/ultralytics/ultralytics](https://github.com/ultralytics/ultralytics)]([https://github.com/ultralytics/ultralytics](https://github.com/ultralytics/ultralytics)), (accessed on 24 April 2023). The network architecture of the YOLOv8 model is composed of three key components: the backbone network, the neck network, and the head network. It differs slightly from the overall structure of the previous YOLO model. The main network structure is illustrated in Figure 4.  
In the backbone network part, YOLOv8 made a significant improvement by replacing the C3 module used in YOLOv5 (Figure 5) with the C2f structure shown in Figure 4. The C2f structure offers a more abundant gradient flow, enhancing the flow of information throughout the network. Additionally, YOLOv8 adjusted the channel numbers differently for different scale models, which further contributed to the overall performance improvement. This enhancement in the backbone network played a crucial role in significantly improving the performance of the YOLOv8 model, leading to better object detection accuracy and more robust feature extraction capabilities [38; 39; 40].  
In the head network section, the previous YOLO model utilized a coupled head structure (Figure 6) that directly inputted the feature output from the convolutional layer into the fully connected layer to output target position and category. However, compared to this structure, the decoupled head (shown in Figure 4) calculates classification and position loss functions separately for obtained feature graphs. This approach effectively reduces parameters and computational complexity while enhancing the generalization ability and robustness of the model. Additionally, YOLOv8 adopts an anchor-free detection method  
Figure 3: Experimental flowchart. Red dashed lines represent model improvements.  
that removes preset anchor frames to predict target boundary frames directly. Although this method has stronger generalization ability, simpler framework design, and better abnormal scale target detection than anchor frame-based methods, it is not suitable for general object detection.  
Figure 4: YOLOv8 model. The red dotted box in the backbone network is the location for adding the CBAM attention module and the red dotted box in the head network represent the loss function improved in this paper. Conv2d, BatchNorm2d, Maxpool2d, and Silu denote Two-dimensional Convolution, Batch Normalization for 2D, 2D Max Pooling, and Silu activation function, respectively.  
Figure 5: C3 module diagram.  
Figure 6: Coupled head structure. The CBL consists of Convolution, Batch Normalization, and LeakyRelu loss function. Conv denotes Convolution.  
Regarding loss functions, the YOLO series adopted a static allocation strategy. However, recognizing the superior performance of dynamic allocation strategies, the YOLOv8 algorithm directly incorporates Task Aligned Assigner. The core concept is to select positive samples based on scores weighted by both classification and regression scores. When calculating the loss function, the Distribution Focal Loss is introduced to tackle the challenge of highly imbalanced quantities of positive and negative samples.