# SC-YOLOv8 Network with Soft-Pooling and Attention for Elevator Passenger Detection
## 3 Method
### Dual-Branch SPP-Fast Module  
The SPP-Fast module is an important feature extraction module in the YOLOv8 backbone network, and is called the SPP-Fast module because of its computational speed advantage over the spatial pyramid pooling (SPP) module. The SPP-Fast module is optimized from the SPP module and uses a serial approach to the max-pooling operation and splices the outputs from each location when the last max-pooling is complete. The SPP-Fast module extracts features using only the max-pooling operation, which can lead to the loss of some local information. In the elevator scene, noise adversely affects the local information in the image, while uneven illumination leads to changes in the global features. To address this problem this paper proposes a dual-branch SPP-Fast module by introducing soft-pooling branches in the SPP-Fast module. This modification aims to enhance feature extraction by merging the soft-pooling operations, thus mitigating the potential loss of local information.  
In the dual-branch SPP-Fast module, the soft-pooling operation selectively preserves pixels based on the pixel weights in the feature map [25]. Soft-pooling achieves this by obtaining normalized results through the SoftMax function, and then retaining pixels according to the weights of the features. This ensures that more crucial features contribute more significantly, addressing the issue of information loss often associated with max-pooling. Soft-pooling enables the thorough utilization of any activation factor within the pooling kernel, while incurring only a lesser additional computational cost. It not only enhances the network model's ability to discriminate between similar feature information but also preserves feature information across the entire receptive field during soft-pooling operations. This helps minimize feature information loss during the pooling process,  
Figure 8: Bottleneck and SC-Bottleneck.  
thereby improving the detection accuracy of the algorithm. During backpropagation, soft-pooling accumulates activations in an exponentially weighted manner, facilitating continuous updates to gradient values. The calculation method for soft-pooling is outlined in Equations (10) and (11).  
\[w_{i}=\frac{e^{a_{i}}}{\sum\limits_{j\in R}e^{a_{j}}} \tag{10}\]  
\[\tilde{a}=\sum\limits_{i\in R}w_{i}\times a_{i}, \tag{11}\]  
where \(w_{i}\) represents the weight of the candidate region, \(a\) represents the weight of the activation mapping, and \(\tilde{a}\) represents the feature map obtained by multiplying and adding weight \(w_{i}\) with activation mapping \(a_{i}\). The significance of weights lies in the fact that a larger value indicates a more crucial pixel, increasing the likelihood of its retention. The advantage of soft-pooling lies in its ability to effectively preserve image information even when the number of features is reduced.  
As shown in Figure 9, the dual-branch SPP-Fast module proposed in this paper can be divided into two parts: one part comprises the max-pooling branch, while the other part consists of the soft-pooling branch. The specific calculation process is detailed in Equations (12)-(14).  
\[Y_{1}=Conv(Concat(Conv(x),M_{1}(x),M_{2}(x),M_{3}(x))) \tag{12}\]  
\[Y_{2}=Conv(Concat(Conv(x),S_{1}(x),S_{2}(x),S_{3}(x))) \tag{13}\]  
\[Y=Concat(Y_{1},Y_{2}) \tag{14}\]  
Here, \(Y_{1}\) and \(Y_{2}\) represent the outputs of the max-pooling branch and the soft-pooling branch, respectively. \(M_{i}(i\in\{1,2,3\})\) represents the output after max-pooling, and  
Figure 9: Structure of dual-branch SPP-Fast.  
\(S_{j}(j\in\{1,2,3\})\) represents the output after soft-pooling. _Conv_ represents the standard convolution operation.