# A YOLOW Algorithm of Water-Crossing Object Detection
## 3 Proposed Method
### Spdcs  
In object detection, preserving important information in feature maps is crucial for the accuracy of the model. This paper expands on the SPD (Space-to-Depth) module and creates the SPDCS (Space-to-Depth-Conv-Se) module. Operations such as step convolution and pooling may result in the loss of important details, so the SPD module avoids step convolution and pooling by using downsampling, thereby preserving the original features to a greater extent. On the basis of SPD, the SPDCS module further adds convolutional operations and attention mechanisms to process the original image, greatly preserving key information in the channel dimension, which helps to prevent the loss of basic information. In this paper, we use SPDCS blocks in the backbone and header to preserve the original features and further improve the representation ability of features and the transmission ability of semantic information through convolutional operations and attention mechanisms.  
The Conv-Se module, as described in the literature, can be expressed as follows:  
\[SE(Conv(X))=\sigma(FC(f_{gap}(Conv(X))))\cdot Conv(X) \tag{1}\]  
\[Conv(X)=W*X+b \tag{2}\]  
In these formulations, the input feature map is denoted as \(X\). The \(Conv(X)\) operation represents the convolution operation on the input feature map using weight parameters \(W\) and a bias term \(b\). \(f_{gap}\) (Global average pooling) calculates the average value of each channel in the feature map \(X\), yielding a compressed global feature representation, and \(FC\) (fully connected layer) performs a linear transformation on the global feature representation. \(\sigma\) (sigmoid activation function) maps the output of the fully connected layer to the range \([0,1]\), producing channel-wise attention weights.  
Figure 4: Architecture of SPPAUG.  
Figure 5: Architecture of the C2f block.  
For any intermediate feature map \(X\) of size \(S\times S\times C_{1}\), the subfeature map sequence can be sliced as follows [52]:  
\[f_{x,y}=X[x:S:scale,y:S:scale],x,y\in[0,scale) \tag{3}\]  
To explain the process in more detail, given any feature map \(X\), the submap \(f_{x,y}\) is formed by selecting all entries \(X(i,j)\), where \(i+x\) and \(j+y\) are divisible by the scale factor. This results in each the submap being downsampled from \(X\) by the scale factor. Simultaneously, \(X\) is convolved and refined through an attention mechanism to obtain a more enhanced feature with dimensions of \(\frac{S}{2}\times\frac{S}{2}\times C_{1}\). Figure 3b presents an example with \(scale=2\), where five subgraphs are obtained, namely \(f_{0,0}\), \(f_{1,0}\), \(f_{0,1}\), \(f_{1,1}\), and \(Conv-Se\), and \(X\) is downsampled by a factor of 2.  
Next, these subfeature maps (\(f_{0,0}\), \(f_{1,0}\), \(f_{0,1}\), \(f_{1,1}\)) and conv-se are concatenated along the channel dimension to obtain the feature map \(X^{\prime}\), which has reduced spatial dimensions by the \(scale\) factor and increased channel dimensions by \(scale^{2}\). In other words, the SPDCS layer transforms the feature map \(X(S,S,C_{1})\) into the intermediate feature map \(X^{\prime}\Big{(}\frac{S}{scale},\frac{S}{scale},\big{(}scale^{2}+1\big{)}C_{1} \Big{)}\). This approach effectively preserves critical information and can improve the accuracy of object detection models.