# Detection of Marine Oil Spill from PlanetScope Images Using CNN and Transformer Models
## 4 Results  
Table 4 presents the evaluation metrics calculated by comparing the predictions and segmentation labels of the test datasets from the five cross-validation folds on the 2600 images. Intersection over Union (IoU) is defined as the ratio of the intersection between the predictions and the labels to their union. The mean Intersection over Union (mIoU) across multiple classes is considered a crucial evaluation metric for image segmentation. The mIoU of the DeepLabV3+ model was 0.740, while the Swin-UPerNet model achieved a mIoU of 0.840, and Mask2 Former achieved 0.804. \begin{table}
\begin{tabular}{c c c c c c c c c} \hline \hline  & & **mIoU** & \
\begin{tabular}{c} **IoU** \\ **(Oil)** \\ \end{tabular} &
\begin{tabular}{c} **IoU** \\ **(Not Oil)** \\ \end{tabular} & **Accuracy** & **Precision** & **Recall** & **F1\_Score** & **Kappa** \\ \hline \multirow{3}{*}{Fold 1} & DL & 0.733 & 0.602 & 0.864 & 0.887 & 0.857 & 0.825 & 0.839 & 0.679 \\ \cline{2-9}  & Swin & 0.836 & 0.756 & 0.916 & 0.933 & 0.912 & 0.906 & 0.909 & 0.817 \\ \cline{2-9}  & M2F & 0.775 & 0.663 & 0.887 & 0.908 & 0.886 & 0.855 & 0.869 & 0.738 \\ \hline \multirow{3}{*}{Fold 2} & DL & 0.723 & 0.576 & 0.870 & 0.889 & 0.837 & 0.825 & 0.830 & 0.661 \\ \cline{2-9}  & Swin & 0.832 & 0.744 & 0.919 & 0.935 & 0.898 & 0.914 & 0.906 & 0.811 \\ \cline{1-1} \cline{2-9}  & M2F & 0.798 & 0.693 & 0.904 & 0.921 & 0.876 & 0.893 & 0.884 & 0.768 \\ \hline \hline \end{tabular}
\end{table} 
Table 4: Performance comparison of 5-fold cross-validation results for DeepLabV3+ (DL), Swin-UPerNet (Swin), and Mask2 Former (M2F). \begin{table}
\begin{tabular}{c c c} \hline \hline
**Model** & **DeepLabV3+** & **Swin-UPerNet** & **Mask2 Former** \\ \hline \hline Input image size & \multicolumn{3}{c}{256 \(\times\) 256} \\ \cline{2-5} Input channels & \multicolumn{3}{c}{4 (Blue, Green, Red, and NIR)} \\ \cline{2-5} Backbone & ResNet101 & Swin Transformer (Swin-B) \\ \cline{2-5} Model & DeepLabV3+ & UPerNet & Mask2 Former \\ \cline{2-5} Loss function & \multicolumn{3}{c}{Binary Cross Entropy} \\ \cline{2-5} Optimizer & Adam & AdamW \\ \cline{2-5} Batch size & 8 & 8 & 4 \\ \cline{2-5} Epoch & 150 & 100 & 100 \\ \cline{2-5} Learning rate & \multicolumn{3}{c}{6 \(\times\) 10\({}^{-7}\)} & \multicolumn{3}{c}{6 \(\times\) 10\({}^{-5}\)} \\ \cline{2-5} Dropout ratio & \multicolumn{3}{c}{0.3} \\ \cline{2-5} Output & \multicolumn{3}{c}{Probability map} \\ \hline \hline \end{tabular}
\end{table} 
Table 3: Hyperparameter settings for oil spill detection using the DeepLabV3+, Swin-UPerNet, and Mask2 Former models. Precision is defined as the ratio of correctly classified pixels within the predicted image to the total number of pixels in that image, whereas recall is defined as the ratio of correctly classified pixels within the label image to the total number of pixels in that image. The precision was 0.847 for DeepLabV3+, 0.910 for Swin-UPerNet, and 0.888 for Mask2 Former, while the recall was 0.842, 0.912, and 0.888, respectively. Generally, low precision indicates overestimation, whereas low recall suggests underestimation. The F1 score, which is the harmonic mean of precision and recall, was 0.843 for DeepLabV3+, 0.911 for Swin-UPerNet, and 0.887 for Mask2 Former. The Kappa coefficient, which quantifies the degree of agreement between the predicted and labeled images, was 0.687 for DeepLabV3+, 0.821 for Swin-UPerNet, and 0.775 for Mask2 Former. Figures 5-9 show the input datasets and predicted images for the three models. The first column displays the input images, with pixel values adjusted to a range of 0 to 255 across the red, green, and blue channels. The remaining columns present the segmentation labels alongside predictions from DeepLabV3+, Swin-UPerNet, and Mask2 Former. While all models demonstrated proficiency in identifying the location and shape of the oil spill class, Swin-UPerNet and Mask2 Former exhibited better accuracy and precision, with fewer instances of missing data compared to DeepLabV3+.