# 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
The training process of \(f_{\theta}(\cdot)\) is to find the optimized parameters \(\theta\) that achieve the smallest MSE loss function \(\mathcal{L}_{\text{MSE}}\) between the output-target image pairs \((f_{\theta}(\mathbf{\hat{Y}}),\mathbf{\hat{Y}})\). Here, to make \(\mathcal{L}_{\text{MSE}}\) only be measured by those pixels masked by Bernoulli sampling, the output-target image pairs employed to calculate \(\mathcal{L}_{\text{MSE}}\) are rewritten as \((f_{\theta}(\mathbf{\hat{Y}})\odot\mathbf{\tilde{B}},\mathbf{\hat{Y}}\odot \mathbf{\bar{B}})\). Assume that there is an available training dataset containing a large of image samples. The training process of \(f_{\theta}(\cdot)\) can be formulated as:  
\[ \begin{split}&\arg\min_{\theta}\{\mathcal{L}_{\text{MSE}}(f_{ \theta}(\mathbf{\hat{Y}})\odot\mathbf{\tilde{B}},\mathbf{\hat{Y}}\odot \mathbf{\tilde{B}})\}\\ &=\arg\min_{\theta}\{\frac{1}{M}\sum_{m=1}^{M}\left(f_{\theta}( \mathbf{\hat{Y}}^{(m)})\odot\mathbf{\tilde{B}}^{(m)}-\mathbf{\hat{Y}}^{(m)} \odot\mathbf{\tilde{B}}^{(m)}\right)^{2}\}^{\prime}\end{split}  \tag{6}\]  
where \(M\) is the number of image samples in the training dataset. \(\mathbf{\hat{Y}}^{(m)}\) and \(\mathbf{\hat{Y}}^{(m)}\) denote the Bernoulli-sampled images of the \(m\)-th training image sample \(\mathbf{Y}^{(m)}\). \(\mathbf{\tilde{B}}^{(m)}\) denotes the Bernoulli-sampled matrix of the \(m\)-th training image sample \(\mathbf{Y}^{(m)}\). Once the training process is completed, we can use the well-trained network to obtain despeckled results. Figure 3: Illustration of the Bernoulli-sampled speckled image pairs. (**a**) Underlying clean image \(\mathbf{X}\) (unseen by our proposed SSD-SAR-BS). (**b**) Synthetic speckled image \(\mathbf{Y}\) corrupted by four-look speckle noise. (**c**,**d**) Speckled input and target images \((\mathbf{\hat{Y}},\mathbf{\hat{Y}})\) generated by the Bernoulli sampling with \(p=0.3\). Next, we explain why this is feasible. It is well known that the MSE loss function is convex, and then, to solve (6), we can derive:  
\[ \begin{split}&\frac{d\mathcal{L}_{\text{MSE}}}{d(f_{\theta}(\hat{ \mathbf{Y}}^{(m)})\odot\bar{\mathbf{B}}^{(m)})}=0\\ \Rightarrow&\frac{2}{M}\sum_{m=1}^{M}\left(f_{\theta }(\hat{\mathbf{Y}}^{(m)})\odot\bar{\mathbf{B}}^{(m)}-\hat{\mathbf{Y}}^{(m)} \odot\bar{\mathbf{B}}^{m}\right)=0\\ \Rightarrow&\frac{1}{M}\sum_{m=1}^{M}\left(f_{\theta }(\hat{\mathbf{Y}}^{(m)})\odot\bar{\mathbf{B}}^{(m)}\right)=\frac{1}{M}\sum_{ m=1}^{M}\left(\hat{\mathbf{Y}}^{(m)}\odot\bar{\mathbf{B}}^{(m)}\right)\\ \Rightarrow&\mathbb{E}[f_{\theta}(\hat{\mathbf{Y}}) \odot\bar{\mathbf{B}}]=\mathbb{E}[\hat{\mathbf{Y}}\odot\bar{\mathbf{B}}]\end{split} , \tag{7}\]  
where \(\mathbb{E}\) denotes the expectation operator. By combining (3)-(5), (7) can be rewritten as:  
\[\mathbb{E}[f_{\theta}(\hat{\mathbf{Y}})\odot\bar{\mathbf{B}}]=\mathbb{E}[\hat {\mathbf{Y}}\odot\bar{\mathbf{B}}]=\mathbb{E}[\mathbf{Y}\odot\bar{\mathbf{B}} \odot\bar{\mathbf{B}}]=\mathbb{E}[\mathbf{Y}\odot\bar{\mathbf{B}}]. \tag{8}\]  
As defined in (1) and (2), the distribution of \(\mathbf{N}\) is the unit mean. Hence, the expectation of \(\mathbf{Y}\) is the same as that of \(\mathbf{X}\), which leads to:  
\[\mathbb{E}[\mathbf{Y}\odot\bar{\mathbf{B}}]=\mathbb{E}[\mathbf{X}\odot\mathbf{ N}\odot\bar{\mathbf{B}}]=\mathbb{E}[\mathbf{X}\odot\bar{\mathbf{B}}]. \tag{9}\]  
According to (8) and (9), we have:  
\[\mathbb{E}[f_{\theta}(\hat{\mathbf{Y}})\odot\bar{\mathbf{B}}]=\mathbb{E}[ \mathbf{X}\odot\bar{\mathbf{B}}]. \tag{10}\]  
Furthermore, we can further approximately simplify (10) to:  
\[\mathbb{E}[f_{\theta}(\hat{\mathbf{Y}})]\approx\mathbb{E}[\mathbf{X}]. \tag{11}\]  
This means that when \(\mathcal{L}_{\text{MSE}}\) obtains the smallest value (i.e., the despecking network parameters \(\theta\) obtain the optimized values), we can obtain despeckled results by using the well-trained network. This is particularly true when a large dataset is employed, in other words \(M\rightarrow+\infty\).