# Spatial Shape-Aware Network for Elongated Target Detection
## 3 Method
### Shape-Sensing Module  
In remote sensing contexts, frequently encountered targets like vehicles and ships usually display elongated shapes and multiple directions of rotation. Traditional sampling  
Figure 2: The design of the Shape-Aware Network (SSAD-Net) targets the detection of elongated objects. The input image undergoes processing via the ResNet50 backbone network and a multi-scale feature pyramid. The modules work collaboratively to optimize feature extraction, anchor selection, and loss computation, enabling precise detection of elongated targets, as shown in the lower examples with ships and orientation-aligned anchors.  
methods generally depend on static IoU thresholds to separate positive from negative samples. However, these fixed thresholds, designed with standard anchor boxes in mind, may not fully accommodate the unique characteristics of elongated targets. Although this approach simplifies the implementation, it risks incorrectly eliminating anchor boxes with lower IoU values that may still represent high-potential samples with essential features.  
To address this limitation, we introduce the Shape-Sensing module (SSM) that dynamically recalibrates the IoU calculations to reflect the target's shape and feature distribution more accurately. First, we introduce a dynamically computed IoU threshold for each true bounding box, enabling the IoU value to better reflect the specific geometric features of elongated targets. For the \(i\)-th true bounding box, the IoU threshold \(T_{iIoU}\) is computed as  
\[T_{iIoU}=f(\alpha_{i})\cdot\left(J+\sigma^{2}\right) \tag{2}\]  
where  
\[\bar{J}=\frac{1}{\int\limits_{j=1}^{J}G_{i,j},\quad\sigma=\sqrt{ \frac{1}{J}\sum_{j=1}^{J}(G_{i,j}-\bar{J})^{2}}} \tag{3}\]  
where J represents the total count of predicted boxes, and \(G_{i,j}\) denotes the IoU value between the \(i\)-th ground truth box and the \(j\)-th predicted box. \(\bar{J}\) represents the mean IoU value for the predicted boxes with respect to the \(i\)-th true bounding box. \(\sigma\) indicates the standard deviation of these IoU values.  
As previously analyzed, elongated targets tend to exhibit lower IoU values as their aspect ratios increase, causing them to be mistakenly excluded. By incorporating a weight factor, the IoU threshold dynamically decreases for targets with higher aspect ratios, ensuring that elongated targets are paired with anchor boxes that better match their unique geometry. To adjust for the effect of the aspect ratio, we introduce a weight adjustment function, \(f(\alpha_{i})\), defined as  
\[f(\alpha_{i})=e^{-\frac{\gamma_{i}}{w}} \tag{4}\]  
where \(w\) is an empirically determined constant, set to 4 in our experiments, used to adjust the scaling factor for aspect ratios. \(\gamma_{i}\) denotes the aspect ratio of the target, defined as the ratio of the longest to the shortest side of the actual bounding box.  
This function ensures that elongated targets receive appropriately scaled weight adjustments, preventing the IoU threshold from being excessively reduced. When the data predominantly contain targets with large aspect ratios, this approach effectively assigns suitable thresholds, enhancing the overall detection performance.