# A Lightweight and Partitioned CNN Algorithm for Multi-Landslide Detection in Remote Sensing Images
## 3 Method
### Lightweight LP-YOLO Model
#### 3.2.4 Using SIoU Loss Function and Attention Mechanism  
To further improve the accuracy, the box regression loss function is another aspect to be considered. The intersection over union (IoU) is a metric utilized in object detection tasks to quantify the similarity between two bounding boxes. The IoU loss function (IoU loss), derived from the IoU metric, is employed as the regression loss function for bounding boxes in object-detection models. The IoU metric serves two primary functions: distinguishing positive and negative samples and assessing the correlation between the predicted box and ground truth box (GT box). For better bounding box regression of the model, a series of metrics (GIoU [40], DIoU, CIoU) have been developed. The YOLOv5 model incorporates the CIoU loss as the bounding box regression loss function to assess the predicted results. The CIoU metric considers factors such as the distance, overlap area, and aspect ratio between the predicted and the GT boxes. However, it does not account for the direction of the mismatch between the predicted and GT box, which can result in slower convergence during the training process [41]. Therefore, to make up for these deficiencies, we introduced the SIoU loss in LP-YOLO. In detail, the SIoU loss consists of 4 cost contributions: angle cost, distance cost, shape cost, and IoU cost. The formula of the SIoU loss is defined as:  
\[L_{S} =1-\text{IoU}+\frac{\Delta+\Omega}{2} \tag{3}\] \[=1-\text{IoU}+\frac{\sum_{t=x,y}(1-e^{-\gamma\rho_{t}})+\sum_{t= w,h}(1-e^{-\omega_{t}})^{\theta}}{2}\]  
where \(\Omega=\sum_{t=w,h}(1-e^{-\omega_{t}})^{\theta}\); this denotes the shape cost, which is used to consider the differences in the aspect ratio between the predicted and GT box. \(\omega_{t}\) means the ratio of the difference between the width of the GT box and the predicted box to the maximum width. The value of \(\theta\) regulates the degree of emphasis placed on the shape loss. In the LP-YOLO model, we set \(\theta\) equal to 4. \(\Delta=\sum_{t=x,y}(1-e^{-\gamma\rho_{t}}),\gamma=2-\varphi\); this denotes the distance cost and is based on penalty metrics of the angle cost. The metric of the angle cost can be defined as:  
\[\varphi=1-2\cdot sin^{2}(arcsin(x)-\frac{\pi}{4}) \tag{4}\]  
where \(x=\frac{C_{h}}{\sigma}=sin(\pi)\), as shown in Figure 7, \(B\) and \(B^{gt}\) represent the centroids of the predicted and the GT box, respectively, where \(\sigma\) denotes the Euclidean distance between the points, and \(\alpha\) represents the angle between \(\alpha\) and the \(X\) axis. \(c_{h}\) denotes the difference in height between the centroids of the two bounding boxes. When the predicted box does not intersect with the GT box, the model endeavors to align the prediction with the nearest axis (if \(\alpha<\beta\), minimize \(\alpha\); otherwise, minimize \(\beta\)) before adjusting it to prevent model confusion.  
The experiments demonstrated that the overall error of the SIoU loss function was more heavily influenced by the number of iterations and ultimately attained a lower value.  
Figure 7: Angle cost contribution.  
Applying the SIoU loss to the landslide dataset can achieve a faster convergence speed during the training process and improve the detection performance.  
In order to increase the model's capacity to prioritize crucial landslide information, suppress redundant background information, and improve detection performance, we incorporated the lightweight CBAM module [42] into the backbone before the SPPF layer. As illustrated in Figure 8, the CBAM module integrates both the spatial attention and channel attention mechanisms to enable the model to selectively attend to pixel regions in the image that are critical for accurate classification. By incorporating CBAM into the backbone, the model is better able to focus on landslide regions and enhance detection accuracy.