# Ship Detection in Sentinel 2 Multi-Spectral Images with Self-Supervised Learning
## 3 Results
### Self-Supervised Learning Approach Analysis  
We train the ship detector on the S2-SHIPS dataset in the leave-one-out setting: out of \(N\) images we choose \(N-1\) for training and one for testing. For certain geographical regions there are several images in the dataset while for others only one. Therefore, by varying the testing and training images we measure the transferability of the learned detector, for different levels of domain difference between training and testing sets. We do not perform cross-validation, the hyperparameters for U-Net are chosen a priori and not optimized.  
We obtain 16 folds with 15 training images and one testing image. The training set consists of patches that match the ship presence criterion described in Section 2.4, extracted from the original images. This sampling produced about 1800 patches on average per fold. We report precision, recall, and F1-score averaged over the 16 folds, averaged over 5 runs of the experiments. We do not report standard deviations as they were always insignificant.  
Our initial aim is to evaluate the overall performance of the detector, irrespective of land cover in the images. Thus, we first test without the filtering stage, and the precision results reflect false positives both on land and at sea.  
Table 2 presents the results of this comparison. First, we can observe that there is a strong relationship between the dataset size and the performance attained. To see this in more detail, in Figure 6 we show graphically the difference in F1 score depending on the size of the pre-training dataset, under the (A)augmentation pre-text task, using transfer learning (TL).  
Using the large SEN12 MS dataset we obtain four percentage points of F1 score more than with EuroSAT for the same pretext task. In Table 2, we note that this gain in performance is due to a stronger gain of relative precision than the loss of relative recall.  
Table 2 also shows that the region-wise similarity, coupled to augmentation (RA), outperforms augmentation-only pre-training (four F1 percentage points in the FT setting). Furthermore, a large maximum positive patch distance is beneficial, compared to low-distance/high overlap (RA-lo).  
Additionally, Table 3 shows how the false alarm rate drastically decreases from 1.70 ship/km\({}^{2}\) for EuroSAT to 1.20 ship/km\({}^{2}\) for SEN12 MS-A without filtering, and down to 0.14 ships/km\({}^{2}\) for the open-sea setting (OS).  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline \multirow{2}{*}{**Pre-Training Dataset**} & \multirow{2}{*}{**SSL Pretext Task**} & \multicolumn{4}{c}{**Transfer Learning**} & \multicolumn{4}{c}{**Fine-Tuning**} \\ \cline{3-8}  & & **Precision** & **Recall** & **F1** & **Precision** & **Recall** & **F1** \\ \hline EuroSAT & A & 17.0 & 80.1 & 24.7 & - & - & - \\ \hline BigEarthNet & A & 19.3 & **81.5** & 27.1 & 18.4 & **78.1** & 26.0 \\ \hline SEN12 MS & A & 21.3 & 76.7 & **29.1** & 22.5 & 74.3 & 29.5 \\ \hline SEN12 MS & RA & **21.9** & 76.9 & **29.1** & 25.2 & 76.4 & **33.0** \\ \hline SEN12 MS & RA-lo & 21.0 & 77.1 & 28.4 & **25.7** & 77.4 & **33.0** \\ \hline \hline \end{tabular}
\end{table}
Table 2: Average performance measures for the various SSL settings, over 5 runs over the 16 folds of the S2-SHIPS dataset. Best results are presented in bold font. Note that the F1-score here is the average of F1 scores over folds.