# Range-Doppler Based CFAR Ship Detection with Automatic Training Data Selection
## 3 Training Data Selection
### Target Pre-Detection  
The proposed target pre-detection method is based on deriving an adaptive threshold which varies along range. Such a threshold is needed because the backscatter received by the radar system is range and incidence angle dependent. The proposed target pre-detection algorithm contains the following major steps:  
* RC radar data extraction in time domain (cf. green region in Figure 4). * Incoherent summation over azimuth. * Range-dependent adaptive threshold computation. * Target peak detection and cancellation. For incoherent summation over azimuth let us consider a set of complex amplitude pixels \(z\) spanning over \(N\) azimuth samples and \(R\) range bins of the scene (cf. green region from Figure 4). The average amplitude profile \(A(r)\) for \(r=1,\ 2,\ 3,\ \ldots R\) of these data is given as  
\[A(r)=\ \frac{1}{N}\sum_{n=1}^{N}\big{|}z(r,\ n)\big{|}, \tag{3}\]  
Figure 7 shows \(A(r)\) which is plotted for different polarization channels of an F-SAR data patch which is free of target. Figure 7: Amplitude over range profile of the sea backscatter in HH, VV and HV polarization channels of RC F-SAR X-band radar data. It can be seen in Figure 7 that the amplitude variation is a function of range and incidence angle, respectively. Generally, high backscatter is received at low incidence angles, the amplitude decreases as the incidence angle increases. The intensity of the backscatter observed is highest in HH channel and lowest in HV channel. It is now clear that for detecting potential targets at any range, the pre-detection threshold has to be adaptive along range. Therefore, the pre-detection threshold \(\eta_{\text{pre}}(r)\) is defined as a function of range \(\eta_{\text{pre}}(r)=f(r)\) where \(r\) is the range. Referring to (3), the samples are incoherently added along azimuth and an average amplitude for each range is computed. Applying a moving average filter to \(A(r)\) will not be an effective step to cancel the target peaks. These peaks might be extremely high which could significantly alter the center mean computed from the samples within the moving window. Instead, we suggest applying a one-dimensional moving median filter of a certain window size because the median is more robust and less sensitive to such outliers. The median \(\widetilde{A}(r)\) of the data vector \(A(r)\) is written as  
\[\widetilde{A}(r)=\text{median}(A(r)), \tag{4}\]  
Instead of using the standard deviation around the mean to compute a pre-detection threshold, we use the median absolute deviation (MAD). Compared to the standard deviation computed from the mean, the MAD is a more robust estimator to measure the statistical dispersion and it is resilient to the outliers present in the data [32]. The \(MAD(r)\) is given as  
\[MAD(r)=\text{median}\bigg{(}\big{|}A(r)-\widetilde{A}(r)\big{|}\bigg{)}, \tag{5}\]  
The \(MAD(r)\) is then used to estimate the standard deviation \(\sigma(r)\) defined as  
\[\sigma(r)=k\cdot MAD(r), \tag{6}\]  
where \(k\) is a scale factor with \(k\approx 1.4826\) representing the 0.75 quantile of the standard Gaussian distribution. The standard deviation \(\sigma(r)\) is further smoothened by applying a Savitky Golay (SG) filter [33] with the window size being same as the one used in median filtering. This filter performs a moving polynomial fit to the data in order to further reduce the noise without greatly affecting the signal. The SG filter becomes a simple moving average filter when the polynomial order is 0. Unlike the moving average filter, which along with the noise also removes the high frequency component of the signal, the SG filter of a certain polynomial order is able to preserve these components in the data. There are no general guidelines to choose an appropriate parameter for the SG filter, however a polynomial order of two is a good compromise which leads to reasonable results for the F-SAR data.