2.4.2. SDC Module

The main idea of SDC is using the SAR ship shape distance to generate the superior prior anchors to match ship shape better. SDC is composed of the following steps.

First, *k* ground-truth anchors are randomly chosen as the k initialization prior anchors. Subsequently, for each ground-truth anchor, the cluster labels of the sample are calculated, which can be described by

$$label\_{i} = \underset{1 \le j \le k}{\operatorname{argmin}} \left( \left( L\_i - L\_j \right)^2 + \left( \mathcal{W}\_i - \mathcal{W}\_j \right)^2 + \left( A R\_i - A R\_j \right)^2 \right)^{\frac{1}{2}} \tag{7}$$

where *Li* denotes the length of the *i*-th ground-truth anchor, *Lj* denotes the length of the *j*-th prior anchor, *Wi* denotes the width of the *i*-th ground-truth anchor, *Wj* denotes the width of the *j*-th prior anchor, *ARi* denotes the aspect ratio of the *i*-th ground-truth anchor, *ARj* denotes the aspect ratio of the *j*-th prior anchor, and *labeli* denotes the label of the *i*-th ground-truth anchor.

Then, the length, width, and aspect ratio of the *j*-th prior anchor are updated by the following formulas:

$$L\_j = \frac{1}{n\_j} \sum\_{i=1}^{n\_j} L\_{i\prime} L\_i \in \mathbb{C}\_j \tag{8}$$

$$\mathcal{W}\_{\dot{\jmath}} = \frac{1}{n\_{\dot{\jmath}}} \boldsymbol{\Sigma}\_{i=1}^{n\_{\dot{\jmath}}} \mathcal{W}\_{i\prime} \mathcal{W}\_{i} \in \mathbb{C}\_{\dot{\jmath}} \tag{9}$$

$$AR\_j = \frac{1}{n\_j} \sum\_{i=1}^{n\_j} AR\_{i\prime} AR\_i \in \mathbb{C}\_j \tag{10}$$

where *nj* denotes the number of ground-truth anchors belonging to the *j*-th prior anchors and *Cj* denotes the *j*-th cluster space.

Finally, iterate Formulas (7)–(10) until the following Formula (11) reaches the local optimal solution:

$$E = \sum\_{j=1}^{k} \sum\_{i=1}^{n\_j} \left( \left( L\_i - L\_j \right)^2 + \left( \mathcal{W}\_i - \mathcal{W}\_j \right)^2 + \left( A R\_i - A R\_j \right)^2 \right)^{\frac{1}{2}} \tag{11}$$

The K-means clustering algorithm is widely used in clustering problems owing to its simplicity and efficiency [44]. Therefore, in our paper, the prior anchors obtained by K-means and the SDC module are shown in Table 2. Figure 9a shows the cluster analysis of LS-SSDD-v1.0 by K-means. Figure 9b shows the cluster analysis of LS-SSDD-v1.0 by the SDC module.

**Table 2.** The prior anchors obtained by K-means and SDC module.


**Figure 9.** (**a**) Cluster analysis of LS-SSDD-v1.0 by K-means; (**b**) cluster analysis of LS-SSDD-v1.0 by SDC module. We set 9 prior anchors just as [27] did. Different colors mean different clusters. Nine cluster centroids are marked by a large circle with different colors. Mean distance means the average Euclidean distance between each ground-truth anchor and its cluster center; smaller is better.

From Figure 9, one can conclude that the proposed SDC module possesses a superior clustering performance (i.e., ~3.90 mean distance < ~4.96 mean distance compared with K-means). Subjectively, in Figure 9, the prior anchors clustered by the SDC module are smaller and roughly symmetrically distributed by the central axis, which conforms to the distribution law of LS-SSDD-v1.0 (i.e., there are numerous of small ships and the aspect ratio of ships is symmetrically distributed.). The above fully confirms the effectiveness of the SDC module.
