# Spatial Shape-Aware Network for Elongated Target Detection
## 3 Method
### Boundary-Guided Spatial Feature Perception Module  
When the target object is elongated and curved, its complex geometry may lead to incomplete and inaccurate coverage throughout the feature extraction process. Consequently, this situation enables convolutional kernels to assimilate substantial background noise, complicating the accurate capture of the target's specific regional features and shape details, which ultimately results in inaccurate geometric localization. Additionally, during feature extraction, the contribution of each pixel differs, indicating that the convolutional process may be disrupted by noise from less significant pixels.  
\begin{table}
\begin{tabular}{p{113.8 pt} p{113.8 pt} p{113.8 pt} p{113.8 pt}} \hline \hline
**Reference** & **Contribution** & **Limitation** & **Improvement Stage** \\ \hline
[23] & Simplified angle calculation, alleviating discontinuity and parameter inconsistency in rotation box regression. & The structure is complex, resulting in slower detection speed. & \\
[24] & Proposed a polar-coordinate-based rotation box representation. & Requires a dataset specifically designed for polar-coordinate-based representation. & Improvement in regression optimization. \\
[25] & Introduced a pixel-wise IoU calculation method, optimizing the loss function. & Faces boundary-related issues that could arise when targets are too small or have extreme rotations. & \\ \hline
[26] & Introduced shape-adaptive selection and shape-adaptive measurement strategies for sample selection and training. Proposed a new Gaussian distribution-based label assignment approach. & Inaccurate or insufficient shape information may affect sample selection effectiveness. & \\
[27] & Redesigned the detection head to better align the features learned for classification and regression tasks. & In the detection head results in increased computational overhead and slower inference. & Improvement in label assignment stage. \\ \hline \hline \end{tabular}
\end{table}
Table 1: _Cont._To optimize the feature extraction process for complex-shaped targets, we introduce a novel Boundary-Guided Spatial Feature Perception Module (BGSF). In addition to the standard feature extraction by convolution, BGSF incorporates a learnable parameter, \(\Delta d_{k}\) and a weight factor \(w_{k2}\), which represent the positional offset and weight information, respectively. Here, p represents the sampling position at the center of the convolution kernel, and \(\Delta p_{k}\) to spread into complex, non-grid shapes. The weight factor denotes the relative position of the sampling points to position. For each output value \(y(p)\), the sampling positions are initially derived from the center of the original convolution kernel, but with an added offset \(\Delta d_{k}\). This adjustment allows the sampling positions, \(\Delta p_{k}\), to spread into complex, non-grid shapes. The weight factor \(w_{k2}\) allocates weights to each sampling position, specifically assigning lower weights to pixels with minimal potential contribution to the target information, thereby mitigating noise impact. The relationship between the output value \(y(p)\) and the sampling points x is defined as follows:  
\[y(p)=\sum_{k=1}^{K}\omega_{k}\cdot\omega_{k2}\cdot x(p+p_{k}+\Delta d_{k}) \tag{1}\]  
Here, the offset \(\Delta p_{k}\) and \(w_{k2}\) are obtained through two separate convolutional layers. Initially, a standard feature map is produced from the input, which is then augmented by layers that calculate the offset map and a weight map with dimensions \(2k\), matching the input feature map's size. The weight factor is then normalized using an activation function to confine its values to the range \([0,1]\). The parameter \(k\) matches the size of the convolution kernel, enabling the deformable convolution to be compatible with other typical convolutional setups.