# SS-YOLOv8: A Lightweight Algorithm for Surface Litter Detection
## 3 SS(Sobel and Share)-YOLOv8 Algorithm
### WS-C2f Module  
The YOLOv8 feature extraction network is structured in a manner similar to the CSPDarkNet network. However, the C2f module, comprising the standard convolution (SConv) and the bottleneck structure (Bottleneck), exhibits shortcomings in terms of a considerable number of parameters and a relatively slow computation speed. To reduce the model's requirements on device arithmetic and memory, and to improve the accuracy of water surface trash detection, this paper constructs the WS-C2f module based on the concept of the Hgnet (Hourglass net) module in the backbone network in RT-DETR [22]  
Figure 1: YOLOv8 architecture diagram.  
and replaces the C2f in the original backbone network with it. The module is designed to serve as an efficient front-end module in image recognition tasks.  
This module fuses Sobel_Conv [23] branching for extracting edge information and convolutional branching for extracting spatial information, thereby enabling the learning of more nuanced representations of image features. The WS-C2f module explicitly extracts the edge features of an image through Sobel_Conv branching. The Sobel filter is a well-established edge detection filter that effectively captures abrupt changes in intensity in an image, thereby obtaining crucial edge information. The Sobel operator is a discrete differential operator used in image processing edge detection algorithms. It detects the approximate gradient used via the edge device to calculate the grayscale of the image by calculating the gradient of each pixel point in the image. The greater the gradient, the more likely that it is an edge. The operator combines a Gaussian smoothing function and differential derivative function. It is also known as a first-order differential operator and derivative operator. It extracts the image in the horizontal direction and the vertical direction, respectively, to obtain the image gradient in the x direction and the y direction. The Sobel operator is based on the assumption that pixels in the neighborhood do not have an equivalent effect on the current pixel. Consequently, pixels at different distances are assigned different weights, which in turn produce varying effects on the results of the operator. In general, the influence of a given point decreases with increasing distance.  
The Sobel operator principle involves convolving the incoming image pixels. Convolution can be understood as a process of identifying the gradient value or performing a weighted average, where the weights are the so-called convolution kernel. Subsequently, a thresholding operation is applied to the resulting new pixel gray value, thereby obtaining the horizontal and vertical gradient information. This information is utilized to determine edge information, as illustrated in Figures 2 and 3 and Equations (1) and (2).  
\[P5_{X}=\sum_{i,j}X_{i}P_{j};i,j\in[1,9] \tag{1}\]  
\[P5_{Y}=X_{1}P_{1}+X_{4}P_{2}+X_{7}P_{3}+X_{2}P_{4}+X_{5}P_{5}+X_{8}P_{6}+X_{3} P_{7}+X_{6}P_{8}+X_{9}P_{9} \tag{2}\]  
The WS module employs an additional convolutional branch, as illustrated in Figure 4, to extract spatial information. In contrast to the Sobel_Conv branch, the convolutional branch is capable of extracting features from the original image, thereby preserving the rich spatial details inherent to the source data. The WS module combines the extracted features from the Sobel_Conv branch and the convolutional branch. The fusion operation permits the learned feature representation to contain both rich edge information and spatial information, thereby facilitating a more comprehensive portray  
Figure 3: Schematic diagram of vertical gradient extraction.  
Figure 2: Schematic diagram of horizontal gradient extraction.