# An Advanced SAR Image Despeckling Method by Bernoulli-Sampling-Based Self-Supervised Deep Learning
## 2 The Proposed Method
### Basic Idea of Our Proposed SSD-SAR-BS  
We use \(\mathbf{Y}\) and \(\mathbf{X}\) to denote the observed speckled intensity SAR image and the corresponding underlying speckle-free SAR image, respectively. The relationship between \(\mathbf{Y}\) and \(\mathbf{X}\) can be characterized by a well-known multiplicative model [11]:  
\[\mathbf{Y}=\mathbf{X}\odot\mathbf{N}, \tag{1}\]  
where \(\odot\) denotes the Hadamard product (i.e., elementwise product) of two matrices. \(\mathbf{N}\) denotes the speckle noise and is considered to follow the independent and identically distributed (i.i.d.) Gamma distribution with unit mean. The probability density function \(P_{r}(\cdot)\) of \(\mathbf{N}\) can be defined as [11]:  
\[P_{r}(\mathbf{N})=\frac{L^{L}\mathbf{N}^{L-1}e^{-L\mathbf{N}}}{\Gamma(L)}, \mathbf{N}\geq 0,L\geq 1, \tag{2}\]  
where \(\Gamma(\cdot)\) denotes the Gamma function and \(L\) is the number of looks. Our objective was to train a deep despeckling network, just using \(\mathbf{X}\) as the training data to reconstruct \(\mathbf{Y}\), that is \(\mathbf{X}\) is invisible during the network training. As previously mentioned, it is feasible to train a denoising network using Noise2 Noise image pairs, which contain the same underlying clean targets. Therefore, a natural idea is: if we can sample two images for a given speckled image, we can use one of them as the input and the other as the target. To do so, we propose a self-supervised SAR image despeckling method based on Bernoulli sampling. Firstly, for each speckled image, only a part of the pixels was used as the input, and the remaining pixels were used as the target. Then, we hoped to generate two matrices as the multiplication operators, whose sizes were the same as that of the original speckled image. The speckled input-target image pairs were obtained by multiplying the original fully speckled image by two matrices, respectively. Due to this reason, we employed the Bernoulli distribution as the sampling method to generate the matrices with one or zero values. Unlike the Bernoulli distribution, some other distributions (e.g., Gaussian distribution) sample a random value between zero and one. If the other distributions  
Figure 2: Overall flowchart of our proposed SSD-SAR-BS. (e.g., Gaussian distribution) are employed to generate two matrices as the multiplication operators, a set of transformation operations needs to be performed before. Hence, the Bernoulli distribution is a simpler and more direct sampling method in this work. Specifically, for each speckled image with a size of \(W\times H\), we used two Bernoulli-sampled matrices (i.e., \(\mathbf{\hat{B}}\), \(\mathbf{\hat{B}}\in\{0,1\}^{W\times H}\)), which can be written as:  
\[\mathbf{\hat{B}}_{wh}=\left\{ \begin{array}{l}1,\text{with probability }p;\\ 0,\text{with probability }1-p,\end{array} \right. \tag{3}\]  
\[\mathbf{\tilde{B}}_{wh}=\left\{ \begin{array}{l}0,\text{if }\mathbf{\hat{B}}_{wh}=1;\\ 1,\text{if }\mathbf{\hat{B}}_{wh}=0,\end{array} \right. \tag{4}\]  
where \(\mathbf{\hat{B}}_{wh}\) and \(\mathbf{\hat{B}}_{wh}\) denote the pixel values in \(\mathbf{\hat{B}}\) and \(\mathbf{\tilde{B}}\), respectively. \(p\in(0,1)\) denotes the probability of the Bernoulli distribution. Then, the corresponding Bernoulli-sampled speckled image pairs \((\mathbf{\hat{Y}},\mathbf{\hat{Y}})\) can be generated:  
\[(\mathbf{\hat{Y}},\mathbf{\hat{Y}})=(\mathbf{Y}\odot\mathbf{\hat{B}},\mathbf{ Y}\odot\mathbf{\bar{B}}), \tag{5}\]  
where \(\mathbf{\hat{Y}}\) is the input of the despeckling network and \(\mathbf{\hat{Y}}\) is the corresponding target. An illustration of the Bernoulli-sampled speckled image pairs is presented in Figure 3.  
With the obtained Bernoulli-sampled speckled image pairs, we can train a deep-learning-based despeckling network \(f_{\theta}(\cdot)\) described in Section 2.2. \(\theta\) denotes the parameters (i.e., weights and biases) of \(f_{\theta}(\cdot)\). Specifically, \(\mathbf{\hat{Y}}\) is used as the input and \(\mathbf{\hat{Y}}\) is used as the target.