# Range-Doppler Based CFAR Ship Detection with Automatic Training Data Selection
## 4 Clutter Statistics and Detection
### K-Rayleigh Distribution  
The presence of a non-Bragg scattering component in the ocean surface, better known as discrete sea spikes, is the main reason why the K-distribution fit fails even when the thermal noise is taken into account [48]. Due to the high intensities of the sea spikes, they are often confused with the target, giving rise to very high false alarms (cf. Figure 18). In recent studies, KA (K-class A), KK and Pareto distribution models, along with their adaptations to consider thermal noise were proposed and investigated to model these sea spikes. However, these models have many unknowns to estimate and require a prior knowledge of the thermal noise [48].  
The K-Rayleigh distribution function is one of the recently proposed distribution functions that models sea spikes as an extra Rayleigh component which is typically not captured by K or even K+Noise (K+N) distributions [48]. In the K-Rayleigh distribution, the total speckle mean from (15) is expressed into two components; \(x=x_{\rm r}+\rho_{\rm r}\) where \(x_{\rm r}\) and \(\rho_{\rm r}\) are the modified speckle mean and the extra Rayleigh component modeled like the thermal noise \(\rho_{\rm n}\). If \(\rho_{\rm r}=0\), it takes the form of the K+N distribution. The texture is modeled as a gamma distribution similar as in the K-distribution. The PDF of the K-Rayleigh distribution has no closed form solution and is given as [48]  
\[f(I,b_{\rm r},v_{\rm r},\ \rho_{\rm r}+\rho_{\rm n})=\ \frac{b_{\rm r}^{v_{\rm r}} }{\Gamma(v_{\rm r})}\int_{0}^{\infty}\frac{x_{\rm r}v_{\rm r}-1}{x_{\rm r}+ \rho_{\rm r}+\rho_{\rm n}}\exp\!\left(-\frac{I}{x_{\rm r}+\rho_{\rm r}+\rho_{ \rm n}}-b_{\rm r}x_{\rm r}\right)\!dx_{\rm r}, \tag{26}\]  
where \(v_{\rm r},\ b_{\rm r}\) are the shape and scale parameters, respectively. There are three unknowns in the K-Rayleigh distribution, and they are estimated using the MoM. The three equations to be solved are  
\[\hat{v}_{\rm r}=\frac{18\!\left(\langle l^{2}\rangle-2\langle l \rangle^{2}\right)^{3}}{\left(12\langle l\rangle^{3}-9\langle l^{2}\rangle \langle l\rangle+\langle l^{3}\rangle\right)^{2}}. \tag{27}\]  
\[(\hat{\rho}_{\rm r+n})=\ \langle l\rangle-\sqrt{\frac{\hat{v}_{\rm r}}{2} \!\left(\langle l^{2}\rangle-2\langle l\rangle^{2}\right)}. \tag{28}\]  
\[\hat{b}_{\rm r}=\frac{\hat{v}_{\rm r}}{\langle l\rangle-(\hat{\rho}_{\rm r+n} )}. \tag{29}\]  
The term \(\hat{\rho}_{\rm r+n}\) consists of \(\hat{\rho}_{\rm r+n}=\rho_{\rm r}+\rho_{\rm n}\), where the Rayleigh offset \(\rho_{\rm r}\) and the thermal noise \(\rho_{\rm n}\) are estimated as a single parameter using (28). Even when the thermal noise is not known, all the parameters needed to fit the data can be well estimated with the above equations. The PFA in this case is computed using (13). A comparison between the detections obtained from the K and K-Rayleigh distribution functions is shown in Figure 19.  
In Figure 19, it is clearly visible that the threshold computed using the K-Rayleigh distribution function is much higher compared to the K-distribution. As a consequence, the number of false alarms is significantly decreased but also the number of true detections.