# SC-YOLOv8 Network with Soft-Pooling and Attention for Elevator Passenger Detection
## 3 Method
### Spatial and Channel Reconstruction Convolution  
The background of elevator surveillance images is complex, and the standard convolutional kernel has limitations in processing elevator surveillance images because the standard convolutional kernel operates on the entire input image and fails to focus on specific regions and channels effectively. This convolutional operation suffers from redundancy of spatial and channel information in complex scenes, which, in turn, leads to degradation of model performance. Specifically, the standard convolutional kernel is unable to differentiate between important and minor regions in the image, and is also unable to effectively identify which channels are critical in the image. This results in the model consuming a large amount of computational resources to process unnecessary information when processing elevator surveillance images. Therefore, in this paper, we propose SC-ConvModule by replacing the standard convolution of the ConvModule of the YOLOv8 network using SCConv. As shown in Figure 2, SCConv [19] consists of a spatial reconstruction unit (SRU) and a channel reconstruction unit (CRU). The SRU separates features with rich information from those with less information, then reconstructs them to enhance representative features and reduce spatial redundancy in the input features. On the other hand, CRU employs a split-transform-fuse method to reduce channel redundancy. The combination of SRU and CRU in the SCConv module aims to enhance the adaptability and generalization performance of the YOLOv8 network, particularly in dealing with the challenging background and various interference factors present in elevator surveillance images. As shown in Figure 3, the SRU reduces spatial redundancy in the input features through separation and reconstruction. The purpose of the separation operation is to separate those feature maps that are rich in spatial information from those with less spatial information. SRU begins by utilizing the scaling factor in the group normalization (GN) layer to assess the information content of different feature maps. The specific calculation of the GN layer is shown in Equation (1). \[X_{out}=GN(X)=\gamma\frac{X-\mu}{\sqrt{\sigma^{2}+\epsilon}}+\beta, \tag{1}\]  
where \(X\) represents the input feature map, and \(\mu\) and \(\sigma\) represent the mean and standard deviation of the feature map \(X\), respectively. \(\epsilon\) is a small positive constant added for the stability of the division. \(\gamma\) and \(\beta\) are trainable affine transformations. Figure 2: The architecture of SCConv. The trainable parameter \(\gamma\) in the GN layer is used to measure the spatial pixel variance for each batch and channel. The more spatially rich the information, reflecting larger spatial pixel changes, the larger \(\gamma\) becomes. The normalized correlation weight \(W_{\gamma}\) of \(\gamma\) is used to represent the importance of different feature maps, calculated in Equation (2). \[W_{\gamma}=\{\omega_{i}\}=\frac{\gamma_{i}}{\sum_{j=1}^{C}\gamma_{j}},i,j=1,2, \ldots C, \tag{2}\]  
where \(C\) is the number of channels in the input feature map. Afterwards, the re-weighted feature map values by \(W_{\gamma}\) are mapped through the sigmoid function to the range \((0,1)\) and filtered by a threshold. We set weights higher than the threshold to 1 to obtain informative weights \(W_{1}\). Additionally, weights higher than the threshold are set to 0 to obtain non-informative weights \(W_{2}\). The specific calculation of \(W_{n}\) is as shown in Equation (3). \[W_{n}=Gate(Sigmoid(W_{\gamma}(GN(X)))),n=1,2 \tag{3}\]  
Finally, the input feature map \(X\) is multiplied by both \(W_{1}\) and \(W_{2}\), respectively, resulting in the separation of the input feature map \(X\) into an information-rich feature map \(X_{1}^{w}\) and a redundant feature map \(X_{2}^{w}\) with almost no information. The computation of feature maps \(X_{1}^{w}\) and \(X_{2}^{w}\) is as shown in Equation (4).