1. Introduction
Synthetic aperture radar (SAR) is a popular remote sensing sensor due to its relatively high resolution and alltime and allweather imaging capability, and it is widely used in various monitoring tasks. Ship detection is one of the important applications for the ocean monitoring, which has attracted great attention from scholars. Constant false alarm rate (CFAR) algorithms are widely used target detection methods due to their simplicity and adaptive ability. For the reason that different kinds of background clutter have different statistical distributions, a large number of CFAR detectors have been proposed with different local statistics. For example, commonly used CFAR detectors include the cellaveraging CFAR (CACFAR) detector [
1], largest CFAR (GOCFAR) detector [
2], twoparameter CFAR (TPCFAR) detector [
3], orderstatistic CFAR detector (OSCFAR) [
4], and smallest CFAR (SOCFAR) detector, etc.
These CFAR detectors can work well in situations where a single target exists among locally homogeneous clutter. Nevertheless, when using a local sliding window to estimate local statistics of the sea background, there is the inevitable problem of CFAR detectors. When multiple targets exist, the sea clutter obtained by using the local window may contain other target pixels [
5,
6,
7]. Therefore, parameters of the clutter’s distribution would be incorrectly estimated, causing a deterioration of the detection performance [
8,
9]. To overcome this drawback, many efforts were devoted to improving the conventional CFAR algorithm. Gao et al. [
10] proposed a censoring approach with an initial detection to exclude the outliers and achieve accurate distribution parameters for the background clutter. However, the censoring depth is difficult to determine. After that, Cui et al. [
8] proposed an iterative censoring scheme for target detection with SAR imagery, which iteratively updates the target maps for censoring. Based on this idea, An et al. [
9] proposed an improved iterative censoring detection scheme to accelerate the CFAR detection. Although the performance is improved, the computational burden is too heavy due to the iterative scheme and the sliding window technique. Hou et al. [
11] proposed a multilayer CFAR, which could overcome the holes and fracture in the traditional detected results using the CFAR method. Although the detection time is greatly reduced for the reason that global CFAR is used instead of local CFAR, the false alarm rate reamins relatively high. Leng et al. [
12] proposed a bilateral CFAR, which could reduce the influence of SAR ambiguities and sea clutter by considering the ship spatial distribution of SAR images.
However, with the increase in SAR image resolution, due to the data acquired by the TerraSAR, ICEYE sensors, etc., new challenges for ship target detection arise, and the conventional CFAR detectors may suffer from severe performance deterioration. For example, the serious speckle of highresolution SAR image increases the probability of a false alarm. Moreover, in highresolution SAR images, a ship target usually contains a multiple number of independent strong scatters [
10,
13]. After CFAR detection, a ship target is likely to be composed of distributed pixels which cannot form a connected region, leading to the loss of information of structure and shape of the ships. Moreover, it is difficult to eliminate the numerous manmade clutter false alarms, such as in urban areas by only considering the pixel intensity differences between the ships and sea clutter [
14].
Nowadays, the superpixel segmentation is applied to SAR data processing [
15,
16]. A ship target can contain one or several connected superpixels after superpixel segmentation, which can offer more useful statistic and structure information than the pixels. Therefore, several superpixelbased ship detection methods have been studied. Combined with a modified two parameter CFAR detector, Yu et al. [
7] used superpixels to accurately obtain the clutter distribution parameters and then perform CFAR detection. Pappas et al. [
6] utilized superpixels instead of rectangular sliding windows to define CFAR guard areas and background. The aim is to achieve better target exclusion from the background band and reduced false detections. Li et al. [
13] regarded superpixels as the basic processing unit instead of a single pixel for SAR image ship detection, which is superior to the traditional CFAR method in terms of detection performance and computational efficiency. Liu et al. [
17] used multiscale superpixels to segment the SAR image by sea and land, with a combination of CFAR detectors to detect the shore ship targets. Li et al. [
18] divided superpixels into pure superpixels and hybrid superpixels, and adaptively selected a sufficient number of pure clutter superpixels for detection threshold estimation.
Although the aforementioned superpixelbased CFAR detectors can improve the ship detection performance, most of the methods are implemented with the sliding window scheme [
2,
10], i.e., the window is moving over all superpixels in the image to adaptively select clutter superpixels, leading to a relatively high computation load, especially for a highresolution SAR image with a large size. In addition, the numerous clutter false alarms are hardly eliminated, causing the detection results to have a high false alarm rate.
Recently, many deeplearningbased ship detection methods have been proposed for SAR images, such as the CenterNet [
19] and multidimensional domain deep learning network [
20], etc. For instance, Zhang et al. [
21] considered the idea of the You Only Look Once (YOLO) series algorithm and proposed a grid convolutional neural network (GCNN) for SAR ship detection. Wang et al. [
22] adjusted the hyperparameters of RetinaNet for SAR ship detection. Zhang et al. [
23] considered combining the multiscale detection strategy, concatenation mechanism, and anchor box idea into a depthwise separable convolution neural network (DSCNN) to achieve SAR ship detection. These methods tried to use large SAR ship datasets, such as the SAR ship detection data set (SSDD) [
24] and OpenSARship dataset [
25], to train the deep learning model and achieve ship detection for input SAR images. Therefore, the detection procedure highly depended on the dataset for the training.
In order to resolve the above problems, this paper applies superpixels to CFAR ship detection, and proposes a superpixelbased nonwindow fast CFAR (SPNWCFAR) ship detector for SAR images, such as the TerraSAR X band, Sentinel1 C band and GF3 C band images. Our previously proposed fast densitybased spatial clustering of applications with noise (DBSCAN) superpixel generation method [
26] was utilized to produce the superpixels for SAR images. Then, we defined the superpixel dissimilarity to automatically select the pure clutter superpixels, which estimated the clutter parameters for each tested pixel, even in the multitarget situations. Moreover, a local superpixel contrast was also defined to optimize the CFAR detection, which could eliminate the numerous clutter false alarms. The main contributions of the proposed method are as follows:
(1) We introduce the superpixels to the CFAR detection, thus avoiding the operation of the sliding window;
(2) The superpixel dissimilarity is used to select the pure sea clutter superpixels, making the clutter’s distribution parameter estimation more accurate. Moreover, the pixels within one superpixel share the same clutter distribution parameters, which results in a very fast CFAR detection;
(3) A local superpixel contrast is used to optimize the CFAR detection, which can reduce the false alarm rate.
The remainder of this paper is organized as follows. The related work, including the CFAR detector and superpixel generation method is briefly introduced in
Section 2.
Section 3 presents a detailed description of the superpixelbased nonwindow fast CFAR method. Then, the experimental results with real SAR images are provided in
Section 4. Some discussions are exhibited in
Section 5. Conclusions are provided in
Section 6.
3. The Proposed CFAR Detector for SAR Imagery
This section gives the details of our proposed superpixelbased nonwindow fast CFAR method, which has a flowchart as in
Figure 1. The original SAR image is firstly segmented by our previous proposed fast DBSCAN superpixel generation method. Then, we define the superpixel dissimilarity to automatically select the pure clutter superpixels, which can actually estimate the clutter parameters for each under test pixel, even in the multitarget situations. It is worth pointing out that the shadow superpixels should be removed since they have no radar echoes but only noises, which may disturb the clutter parameter estimation and degrade the detection performance. After that, a local superpixel contrast is also defined to optimize the CFAR detection, which can eliminate the numerous clutter false alarms. Since the undertest pixels in the same superpixel share the same background clutter model parameters, no pixelbypixel clutter parameter estimation is required, making the detection efficient. More importantly, our proposed CFAR detection is not performed on all pixels but only on the potential target superpixels, which can achieve fast target detection.
3.1. Superpixel Segmentation with the Fast DBSCAN Algorithm
This subsection gives the brief description of the superpixel segmentation strategy in our method. The original fast DBSCAN superpixel generation algorithm in [
26] consists of two stages, i.e., fast clustering and merging. In the clustering stage, a new adaptive pixel dissimilarity measure for SAR image is proposed and then the DBSCAN strategy is optimized. In the merging stage, based on the initial superpixels, a new superpixel dissimilarity measure is defined, which can merge the small local superpixels into their neighborhood superpixels, making the final superpixel segmentation compact and regular. Note that the edge information of SAR images is considered in the pixel dissimilarity and superpixel dissimilarity, which can maintain the image boundaries during superpixel generation. However, for simplicity, we do not consider the edge penalty for the superpixel generation in this paper, which can accelerate this stage. Thus, the pixel dissimilarity
$\mathsf{\Omega}\left(i,j\right)$ is defined as: [
26]
where the intensity dissimilarity
$\delta \left(i,j\right)$ of pixels
$i$ and
$j$ can be defined based on the likelihood ratio test statistic using two
$5\times 5$ patches
${P}_{i}$ and
${P}_{j}$ which are centering the two pixels as [
26]:
The ${\overline{I}}_{{P}_{i}}$ and ${\overline{I}}_{{P}_{j}}$ indicate the average intensity of two patches. $M$ is the number of pixels in the patch. $L$ is the number of looks of the SAR images. The $\mathcal{H}\left(i\right)$ and $\mathcal{H}\left(j\right)$ in Equation (5) denote the homogeneity of two pixels, which can be calculated by the coefficient of variation of SAR image. The $k$ in Equation (5) denotes a seed, which is the center of each generated superpixel. The clustering stage seems like region growing, which will stop until the termination condition is satisfied. Then, the initial superpixels are generated after getting enough pixels with different labels.
In order to eliminate the small superpixels, we then perform the merging stage, which merges the superpixels and eliminate small fragments, leading to final superpixel results. If the number of pixels within one initial superpixel is less than a threshold, we will merge it with its neighbor initial superpixel which has the lowest dissimilarity. The superpixel dissimilarity
$\mathsf{\Omega}\left(S{P}_{m},S{P}_{n}\right)$ is defined as:
where
$size\left(\xb7\right)$ indicates the superpixel size. We can see that the superpixel dissimilarity considers intensity and homogeneity information. Two superpixels have similar intensity values and homogeneity will be easily merged. Further details of the implementation of the fast DBSCAN superpixel generation method can be found in [
26].
3.2. Shadow Superpixels Elimination
Considering that the shadow areas in the SAR images have no radar echoes, therefore, there is no texture information in the SAR images. The shadow superpixels would disturb the estimation of the clutter distributions, resulting in degrading the CFAR detection performance. Thus in this paper, we eliminate the shadow superpixels before the selection of clutter superpixels. Generally, we can set a threshold ${T}_{sh}$ according to the average intensity values of the shadow areas in the training SAR data. The superpixels whose average pixel intensities lower than ${T}_{sh}$ can be regarded as shadow superpixels, which should be removed from the superpixel set.
3.3. Clutter Superpixels Selection and Local Superpixel Contrast Map Claculation
The traditional CFAR algorithm performs pixelbypixel detection through a sliding window which contains the clutter area, the guard area and the target area, which has a considerable computational load [
10]. Moreover, with the improvement of the SAR image resolution, it would be difficult for the pixellevel CFAR to suppress the false alarms completely while keeping the full shape information of the targets. Superpixels are introduced into the CFAR algorithm which would be beneficial to the selection of clutter area. For the superpixel under test, there are generally three approaches which can obtain the clutter superpixels, as shown in
Figure 2. Pappas et al. [
6] proposed a topology where the superpixel size is much larger than the ship target to ensure that the ship target is contained in only one superpixel, as shown in
Figure 2a. Then, the guard area and the clutter area can be determined accordingly. This method cannot well handle the multiple targets which assemble together. Yu et al. [
7] proposed a local sliding window similar to traditional CFAR algorithms, as shown in
Figure 2b. Note that this strategy needs the determination of window size according to the target size in SAR images. Moreover, the computation complexity is relatively high. Li et al. [
5,
35] proposed using a neighborhood strategy to choose the clutter superpixels, as shown in
Figure 2c, which illustrates the Bhattacharyya dissimilarity, used to determine the neighbor superpixels. It is worth pointing out that the neighborhood scheme consumes less time to compute clutter statistics with less superpixels. However, the selection accuracy of the clutter superpixels depends on the dissimilarity.
In this subsection, we choose the neighborhood scheme to select the superpixels, which can eliminate the determination of local sliding window size. Moreover, we propose to use the superpixel dissimilarity in Equation (7) to select the pure sea clutter superpixels, making the clutter’s distribution parameter estimation more accurate. Thus, the pixels within one superpixel share the same clutter distribution parameters, which results in a very fast CFAR detection. After the superpixel generation of the SAR image, the superpixel set ${\mathcal{R}}_{all}$ can be obtained. We perform the Kmeans clustering algorithm to classify the ${\mathcal{R}}_{all}$ into two subsets ${\mathcal{R}}_{target}$ and ${\mathcal{R}}_{background}$ according to the average intensity of each superpixel. The ${\mathcal{R}}_{target}$ contains the superpixels with high intensity values, which may be the ship target and the manmade structures on the land, etc. In contrast, ${\mathcal{R}}_{background}$ is the superpixel set with low intensity values such as the clutter area or the bare soils on the land.
Then, for each under test superpixel
$S{P}_{i}$ in the
${\mathcal{R}}_{target}$, we define an empty set
${S}_{clutter}$ to contain the clutter superpixels. The local clustering is performed for each neighbor superpixel of
$S{P}_{i}$ which belongs to the
${\mathcal{R}}_{background}$ set. If the dissimilarity measure is more than a predefined threshold
$\mathrm{T}{\mathrm{h}}_{clu}$, the neighbor superpixel can be regarded a clutter superpixel and is added into the
${S}_{clutter}$. We then find all of the neighbor superpixels that in the
${\mathcal{R}}_{background}$ set of the clutter superpixel, then calculate the dissimilarity measures between each neighbor superpixel and the clutter superpixel. The neighbor superpixel whose dissimilarity measures are less than
$\mathrm{T}{\mathrm{h}}_{clu}$ can be regarded a new clutter superpixel and is added into the
${S}_{clutter}$. The iteration procedure will not stop until the termination condition is satisfied, such as the maximum size of
${S}_{clutter}$. For each superpixel, the neighbor superpixel can be obtained with this manner as follows. For each pixel in the current superpixel, we select its eight neighborhood pixels. If they have the same superpixel label with the test pixel, then move to the next pixel. Otherwise, the neighborhood pixel which has a different superpixel label can be regarded as the pixels in the neighbor superpixel. The pseudocode of the clutter superpixel selection is presented in Algorithm 1, as follows.
Algorithm 1. Clutter Superpixel Selection 
Input: the superpixel generation set ${\mathcal{R}}_{all}$ for the SAR image, the threshold $\mathrm{T}{\mathrm{h}}_{clu}$ and the maximum size of ${S}_{clutter}$. Output: ${S}_{clutter}$ for each under test superpixel. The main steps:
 1:
Perform the Kmeans clustering algorithm to classify the ${\mathcal{R}}_{all}$ into two subsets ${\mathcal{R}}_{target}$ and ${\mathcal{R}}_{background}$ according to the average intensity of each superpixel;  2:
for each under test superpixel $S{P}_{i}$ in ${\mathcal{R}}_{target}$ do  3:
for each neighbor superpixel $S{P}_{i}^{k}$ of $S{P}_{i}$, $S{P}_{i}^{k}\in {\mathcal{R}}_{background}$, do  4:
Calculate the superpixel dissimilarity $\mathsf{\Omega}\left(S{P}_{i},S{P}_{i}^{k}\right)$  5:
The $S{P}_{i}^{k}$ with dissimilarity measure more than $\mathrm{T}{\mathrm{h}}_{clu}$ is added into the ${S}_{clutter}$.  6:
end  7:
for each neighbor superpixel of the superpixel ${S}_{clutter}^{i}$ in ${S}_{clutter}$ do  8:
Calculate the superpixel dissimilarity between ${S}_{clutter}^{i}$ and its neighbor superpixel.  9:
The neighbor superpixel with dissimilarity measure less than $\mathrm{T}{\mathrm{h}}_{clu}$ is added into the ${S}_{clutter}$.  10:
end  11:
Iteratively run step (7) to step (10) until the maximum size of ${S}_{clutter}$ is achieved.  12:
end

The difference between our clutter superpixel selection method and the strategy in Li et al. [
5,
35] is that our method firstly classify the generated superpixels into the potential target superpixels and background superpixels. Thus the target detection is only performed on the potential target superpixels, which can avoid the calculation for the background superpixels, leading to the acceleration of target detection. Moreover, unlike
Figure 2c, our method not only selects the neighbor superpixels of the under test target superpixel, but also can capture the nonlocal superpixels which have the similar attributes with the target superpixel. Therefore, the clutter superpixels can contain more nonlocal information when dealing with the multitarget situation, which contributes to the parameter estimation of the clutter statistical model.
In order to resolve the false alarms such as manmade structures and low bushes, this paper proposes a local superpixel contrast map to enhance the target superpixels. We assume that the ship targets are located in the sea areas, where the superpixels have relatively low intensity values. In contrast, the surrounding areas of manmade structures on the land would have superpixels with relatively higher intensity values. Thus, a local superpixel contrast map can be defined to enhance the local contrast between the ship target superpixels and the background areas, which can optimize the following CFAR detection result. The local contrast value for superpixel
$S{P}_{m}$ can be computed as:
where
$\mathsf{\Omega}\left(S{P}_{m},S{P}_{n}\right)$ denotes the superpixel dissimilarity.
$\omega \left(S{P}_{m},S{P}_{n}\right)$ represents the dissimilarity weight, which can be defined as:
where
${\mathrm{D}}_{spatial}\left(S{P}_{m},S{P}_{n}\right)$ is the spatial Euclidean distance between the centers of superpixels
$S{P}_{m}$ and
$S{P}_{n}$.
${\sigma}_{spatial}^{2}$ is a factor and can be set as 0.6 in this paper. From the definition of
${C}_{local}\left(S{P}_{m}\right)$, it can be found that the local contrast of superpixel
$S{P}_{m}$ is related to the superpixel dissimilarity and the spatial distance between
$S{P}_{m}$ and its clutter superpixels. For the ship targets in the sea, the dissimilarity measure is large and the spatial distance is low, thus leading to a large contrast. For the manmade structures on the land, although the dissimilarity measure is large, the spatial distance between the manmade structure superpixel and its clutter superpixel is also large, leading to a restively low large contrast. Therefore, the local superpixel contrast map can enhance the significance of potential ship target.
3.4. SuperpixelBased CFAR Detection
After obtaining the clutter superpixels for each potential target superpixel, we can perform the CFAR detection. The gamma distribution is adopted for the clutter statistical model since the gamma distribution is suitable for the highresolution SAR ship detection. The shape and inverse scale parameter of the gamma distribution can be estimated by using Equation (4), where the pixels used for the estimation are from the clutter superpixels. Thus all the pixels within one under test target superpixel share the same estimated parameters.
Then, for each under test target superpixel
$S{P}_{m}$, the corresponding detection threshold
${\mathrm{Th}}_{cfar}$ can be obtained with a specified falsealarm rate
${P}_{fa}$ according to the following equation:
where
$f\left(x\right)$ denotes the gamma distribution, as shown in Equation (3). Based on the assumption that the pixels in the same superpixel share similar intensity information, they can be judged using the same threshold since the estimated parameters of the clutter statistical model are the same. Therefore, the decision efficiency can be improved. Based on the following decision criterion, the pixels
$I\left(x\right)$ contained in each under test target superpixel
$S{P}_{m}$ can be determined as:
In order to eliminate the manmade structures false alarms, the local superpixel contrast map
${C}_{local}\left(S{P}_{m}\right)$ of superpixel
$S{P}_{m}$ can be considered to optimize the CFAR detection as:
Due to the manmade structures have relatively low local superpixel contrast values, therefore, the decision in Equation (13) can further suppress the false alarms and enhance the ship target pixels. Finally, the pixel detection result should be mapped to superpixel detection map with postprocessing. For the reason that one superpixel contains the pixels with similar attributes, the same superpixel should be labeled as one class. If the number of pixels which are detected as target pixels in Equation (13) exceeds one threshold, the corresponding superpixel should be regarded true target superpixel and all the pixels in it are labeled as target pixels. Otherwise, the superpixel is regarded as background. Thus, the isolated false alarm pixels can be eliminated.