# SS-YOLOv8: A Lightweight Algorithm for Surface Litter Detection
## 3 SS(Sobel and Share)-YOLOv8 Algorithm
### SCDH-Detect Module  
The most significant alteration is evident in the head component of YOLOv8. As the designation \"Decoupled-Head\" implies, this configuration entails the decomposition of the original single detection head into two distinct components. The three decoupled heads in the head section are analogous to the feature map outputs P3, P4, and P5 in the neck section. After entering the decoupling head, it is divided into two branches, and after undergoing three convolutional layers, it obtains the confidence score for each class and the four coordinates (center point coordinates, width, and height) for the regression bounding box, so as to accurately locate the object, as illustrated in Figure 5.  
Feature maps obtained from the network, designated as P3, P4, and P5, are fed into the decoupling header for prediction purposes. Additionally, these maps are incorporated into the regression branch of the detection header. The regression header is responsible for computing the positional offsets between the predicted box and the actual box. Subsequently, the offsets are fed into the regression header for loss computation, resulting in the generation of a four-dimensional vector. It represents the upper-left coordinates x and y and lower-right coordinates x and y of the target box, respectively. The classification head performs RoI (Region of interest) Pooling and convolution processing on each anchor-free generated candidate box to obtain a classifier output tensor. Each position value of this tensor represents the probability that the candidate box belongs to a class. Finally, maximum value suppression (NMS) is used to filter out the final detection results. Group normalization (GN) [24] is an improved algorithm based on the high error rate of batch normalization (BN) [25] when the size of the batch is small, because the calculation  
Figure 4: WS-C2f modular structure. Figure 5: Head structure. results of the BN layer depend on the data of the current batch. When the batch size is small (such as 2 and 4), the mean and root mean square of batch data are less representative and, therefore, have a greater impact to the end result. GN divides the channel into groups and calculates the normalized mean and variance for each group. For each feature channel, GN calculates the mean and variance within each group and then uses these statistics to standardize the features within each group. The calculation of GN is not affected by the batch size, so the accuracy remains consistent under different batch sizes. In other words, the normalization operation of GN is independent of batch size. The formula is as follows:  
\[\widetilde{x_{i}}=\frac{1}{\sigma_{i}}(x_{i}-\mu_{i}) \tag{3}\]  
\[\mu_{i}=\frac{1}{m}\sum\limits_{k\in S_{i}}x_{k},\sigma_{i}=\sqrt{\frac{1}{m} \sum\limits_{k\in S_{i}}\left(x_{k}-\mu_{i}\right)^{2}+\epsilon} \tag{4}\]  
with \(\epsilon\) as a small constant. Where \(x\) is a feature computed by layer with feature size \((N,C,HW)\), and \(m\) is the size \(S_{i}\) of this set varying with different normalization methods in GN, where \(x\) is a feature computed by layer with feature size \((N,C,HW)\), and \(m\) is the size \(S_{i}\) of this set varying with different normalization methods; in GN,  
\[S_{i}=\left\{k\middle|k_{N}=i_{N},\left|\frac{k_{C}}{\zeta}=\frac{i_{C}}{\zeta }\right|\right\} \tag{5}\]  
where \(G\) is the number of groups and is a predefined hyperparameter (default is \(G=32\)). \(c/G\) is the number of channels in each group, and GN computes and \(\sigma\) along \((C/Ge,H,W)\). Therefore, the core idea of GN is to normalize each set of identical feature maps, and these groups are divided only in the channel dimension, making the normalization process independent of batch size. To reduce the size of the model, this paper refers to the use of the same set of convolutional kernels for the three output layers through the use of shared convolution [26]. Significantly reducing the number of parameters makes the model lighter, especially on resource-constrained devices.