# Spatial Shape-Aware Network for Elongated Target Detection
## 3 Method
### Anchor Potential Comparison Module  
Compared to points located within the interior of a target object, points near the object's boundary tend to include more background information or even information from nearby targets. The points located deep within the object, distant from its boundary, especially those near the target's centroid, are better representatives of the object's features than points near its boundary. Assigning uniform weights to all positive samples could cause high-potential positive samples located farther from the object's center to be overwhelmed by low-potential background points which are closer to the center. For instance, in remote sensing contexts that deal with targets characterized by high aspect ratios, critical points on the long edges of the objects that are far from the center could be suppressed by background points on the short edges near the center. This analysis underscores that the identification of each point is intimately connected not only with its proximity to the object's center but also with the characteristics of the object's shape.  
To reflect the quality differences among positive samples during neural network training, we propose SSM to extract and utilize the potential information of each sample. Specifically, the potential of a sample being positive is calculated based on its standardized distance from the center of the targets. The standardized distance is calculated using the Euclidean distance between the centers of the target and the positive sample, combined with the shape information of the target. Five parameters \((x,y,w,h,\theta)\) are used to represent each ground truth box, where \((x,y)\) are the center coordinates of the target, \(w\) is the length of the long side of the ground truth box, \(h\) is the length of the short side, and \(\theta\) is the angle of rotation. The standardized values of \(w\) and \(h\) along the x-axis or y-axis are determined by the angle \(\theta\) rotation angle. The standardized shape distance between the \(i\)-th object and the center of the \(j\)-th positive sample is calculated as follows:  
\[\Delta D_{ij}=\begin{cases}\sqrt{\frac{(x_{i}-x_{j})^{2}}{\omega_{i}}+\frac{(y _{i}-y_{j})^{2}}{h_{i}}}&if\ \ 0\leq\theta_{i}\leq\pi/2\\ \\ \sqrt{\frac{(x_{i}-x_{j})^{2}}{h_{i}}+\frac{(y_{i}-y_{j})^{2}}{\omega_{i}}}& otherwise\end{cases} \tag{5}\]  
where \((x_{i},y_{i})\) are the coordinates of the object's center. \((x_{j},y_{j})\) are coordinates of the positive sample. \((\omega_{i},h_{i})\) are the width and height of the ground truth. \(\theta_{i}\) represents the rotation angle of the object. Once the standardized shape distance is obtained, the potential of the positive sample, \(P_{ij}\), is calculated using an activation function (sigmoid function):  
\[P_{ij}=\frac{1}{1+e^{-\Delta D_{ij}}} \tag{6}\]  
Through the standardization of shape distances, each positive sample is assigned unique potential information. This approach alleviates the suppression of high-potential positive samples, which are critical for representing important target features, by low-potential background points near the object's center. As a result, it mitigates issues in high-aspect-ratio remote sensing targets where key features on the long edges are overshadowed by less relevant short-edge points near the center.