# A Semi-Supervised Deep Learning Framework for Change Detection in Open-Pit Mines Using SAR Imagery
## 3 Method
To achieve a standardized input data distribution for network training, we apply the hyperbolic tangent (tanh) function, resulting in the equation:  
\[x_{i}^{norm}=\frac{1}{2}(\tanh(\frac{x_{i}^{mz}}{W})+1) \tag{4}\]  
where \(x_{i}^{norm}\) represents the normalized amplitude values. The variable \(W=3\) serves as an outlier detection threshold. Any data points with \(x_{i}^{mz}\) scores exceeding \(W\) are considered potential outliers and are discarded [37]. Finally, we normalize the obtained data to the interval [0, 1]. Our change detection model takes as input the concatenation of the amplitudes and the coherence employing an early fusion strategy:  
\[x =(x_{before},x_{after},\rho)\in\mathbb{R}^{H\times W\times 3} \tag{5}\] \[\hat{\rho} =\mathcal{M}_{\phi,\theta}(x)=\mathcal{D}_{\phi}(\mathcal{E}_{ \theta}(x)),\text{ where }\mathcal{M}_{\phi,\theta}=\mathcal{D}_{\phi} \circ\mathcal{E}_{\theta} \tag{6}\]  
where \(D_{\phi}\) and \(E_{\theta}\) represent the encoder and decoder components of the model, and \(\phi\) and \(\theta\) their weights. The model produces as output a binary probability map:  
\[\mathcal{M}_{\phi,\theta}(x)\in[0-1]^{H\times W\times 3} \tag{7}\]  
Figure 2 shows the structure used to construct our network. The encoder, which extrapolates useful features compressing the input image, is composed of four convolutional blocks. Each block is structured by stacking a convolutional layer followed by a batch normalization layer and an activation function (ReLU). On the other hand, the encoder path used to retrieve the original image by mapping back the latent representation is composed of another four convolutional blocks structured like the encoder blocks. In order to train our model, we employed binary cross entropy loss:  
\[\mathcal{L}_{\phi,\theta}(y,x)=-y\log(\mathcal{M}_{\phi,\theta}(x))+(y-1)\log (1-\mathcal{M}_{\phi,\theta}(x)) \tag{8}\]  
where \(y\) represents the label. Due to the small size of our dataset, during the model training, we encountered several problems related to the training stability and overfitting. To address these problems, we considered multiple data augmentations and included them during the training of the model. In addition to the classic geometric transformations, i.e., vertical/horizontal flip and shear, we introduced custom data augmentations. Input channel swap is an operation used to make the model invariant to the temporal order in which the change occurred. It is computed by simply swapping the order of the \(x_{before}\) and \(x_{after}\) images in the network input. Finally, we implemented a custom data augmentation for coherence. In particular, the method consisted of randomly scaling the coherence in areas without change and having a coherence lower than a predefined threshold \(\tau\). \[\rho_{aug}(x,y)= \begin{cases}\rho(x,y)\cdot u,&y(x,y)=0\text{ and }\rho(x,y)<\tau\\ &\text{where }u\sim Uniform[0-1]\\ \rho(x,y),&\text{otherwise}\end{cases}  \tag{9}\]  
In this way, we forced the network not to perform a simple coherence threshold, thus making it robust for areas characterized by low coherence values (e.g., forest, grass) but which do not contain a change of interest. The selection of each data augmentation was carried on empirically by individually selecting it if it improved the validation results with respect to the baseline without augmentations. Appendix B summarizes all the tested data augmentation techniques and their individual improvement in the overall F1-Score.