license: agpl-3.0
library_name: ultralytics
tags:
- satellite imagery
- marine traffic
- sentinel-2
- yolov8
model-index:
- name: mayrajeo/marine-vessel-detection-yolov8
results:
- task:
type: object-detection
metrics:
- type: precision
value: 0.81
name: mAP@0.5(box)
Model Card for YOLOv8 models for detecting marine vessels from RGB Sentinel-2 images
Model Details
Model Description
These model weights are meant for detecting marine vessels from RGB Sentinel-2 imagery.
The models are trained and validated on human-annotated marine vessel data. These annotations, information of which Sentinel-2 product they correspond to, and instructions on how to convert them into COCO or YOLO format datasets will be made available as GeoPackage files on Zenodo portal in the near future.
- Developed by: Janne Mäyrä
- Model type: Object Detection
- Finetuned from model: YOLOv8 pretrained models
Model Sources
- Paper: Under progress
- Demo: https://huggingface.co/spaces/mayrajeo/marine-vessel-detection
Uses
Direct Use
Models are trained to process 320x320 pixel patches of Sentinel-2 RGB images with 10m resolution and detect marine vessels which are upsampled into 640x640 pixels during training and inference. The models will detect targets from outside of the water areas, but those detections can be eliminated by using external datasets such as land masks.
Out-of-Scope Use
These models are not suitable for other purposes than for detecting potential marine vessels from satellite imagery.
Recommendations
The models are most accurate on more closed water areas such as denser archipelagos and close to the coast instead of open sea. Especially during windy conditions the models incorrectly detect a large number of wakes and glint as marine vessels.
How to Get Started with the Model
[https://github.com/mayrajeo/ship-detection] provides examples on how to use the models.
Training Details
Training Data
The model is trained using the following Sentinel-2 mosaics and manually annotated marine vessel data. Archipelago sea 2 and Kvarken were used as test data. Other three locations were sliced into 320x320 pixel patches. These patches were then spatially split into five equal sized folds so that each fold contained data from all timesteps and locations, and all patch locations that contained an annotated vessel in any timestep were included in the folds. In total, this dataset contained 3264 320x320 pixel image patches, of which 1974 contained annotated vessels and 1290 were background patches.
Training and validation data:
Location | Date | Number of annotations | Annotated patches | Background patches |
---|---|---|---|---|
Archipelago sea | 2022-06-19 | 519 | 271 | 269 |
Archipelago sea | 2022-07-21 | 1518 | 387 | 153 |
Archipelago sea | 2022-08-13 | 1368 | 402 | 138 |
Gulf of Finland | 2022-06-06 | 278 | 138 | 241 |
Gulf of Finland | 2022-06-26 | 1206 | 269 | 110 |
Gulf of Finland | 2022-07-21 | 971 | 260 | 119 |
Bothnian Bay | 2022-06-27 | 122 | 81 | 88 |
Bothnian Bay | 2022-07-12 | 162 | 98 | 71 |
Bothnian Bay | 2022-08-28 | 98 | 68 | 101 |
Training Hyperparameters
Training configs can be found from each model directory, in the file args.yaml
.
Evaluation
Testing Data, Factors & Metrics
Testing Data
Test data consists of six Sentinel-2 mosaics:
Location | Date | Number of annotations |
---|---|---|
Bothnian sea | 2021-07-14 | 433 |
Bothnian sea | 2022-06-24 | 413 |
Bothnian sea | 2022-08-13 | 391 |
Kvarken | 2022-06-17 | 79 |
Kvarken | 2022-07-12 | 167 |
Kvarken | 2022-08-26 | 81 |
Factors
Before evaluating, the predictions for the test set are cleaned using the following steps:
- All prediction whose centroid points are not located on water are discarded. The water mask used contains layers
jarvi
(Lakes),meri
(Sea) andvirtavesialue
(Rivers as polygon geometry) from the Topographical database by the National Land Survey of Finland. Unfortunately this also discards all points not within the Finnish borders. - All predictions whose centroid points are located on water rock areas are discarded. The mask is the layer
vesikivikko
(Water rock areas) from the Topographical database. - All predictions that contain an above water rock within the bounding box are discarded. The mask contains classes
38511
,38512
,38513
from the layervesikivi
in the Topographical database. - All predictions that contain a lighthouse or a sector light within the bounding box are discarded. Lighthouses and sector lights come from Väylävirasto data,
ty_njr
class ids are 1, 2, 3, 4, 5, 8 - All predictions that are wind turbines, found in Topographical database layer
tuulivoimalat
- All predictions that are obviously too large are discarded. The prediction is defined to be "too large" if either of its edges is longer than 750 meters.
Metrics
Precision and Recall with IoU-threshold of 0.5, mAP50 and mAP.
Results
5-fold cross-validation results:
Model | ('Precision', 'max') | ('Precision', 'mean') | ('Precision', 'min') | ('Recall', 'max') | ('Recall', 'mean') | ('Recall', 'min') | ('mAP', 'max') | ('mAP', 'mean') | ('mAP', 'min') | ('mAP50', 'max') | ('mAP50', 'mean') | ('mAP50', 'min') |
---|---|---|---|---|---|---|---|---|---|---|---|---|
yolov8n | 0.806493 | 0.787567 | 0.774563 | 0.844089 | 0.827987 | 0.809585 | 0.288 | 0.2826 | 0.275 | 0.771 | 0.7492 | 0.73 |
yolov8s | 0.82737 | 0.816531 | 0.809291 | 0.867093 | 0.852268 | 0.842173 | 0.309 | 0.3044 | 0.298 | 0.789 | 0.7776 | 0.763 |
yolov8m | 0.849967 | 0.824472 | 0.804688 | 0.874121 | 0.856741 | 0.832588 | 0.323 | 0.3162 | 0.311 | 0.81 | 0.784 | 0.765 |
yolov8l | 0.837152 | 0.823104 | 0.811286 | 0.867093 | 0.860703 | 0.854313 | 0.323 | 0.3206 | 0.315 | 0.795 | 0.7888 | 0.782 |
yolov8x | 0.830968 | 0.821126 | 0.804322 | 0.86262 | 0.852013 | 0.823003 | 0.32 | 0.3132 | 0.301 | 0.793 | 0.781 | 0.752 |
Models with best performance for test set for each model architecture:
Model | Fold | Precision | Recall | mAP50 | mAP |
---|---|---|---|---|---|
yolov8n | 1 | 0.794348 | 0.844089 | 0.771 | 0.288 |
yolov8s | 4 | 0.817963 | 0.867093 | 0.784 | 0.303 |
yolov8m | 4 | 0.825090 | 0.874121 | 0.810 | 0.323 |
yolov8l | 1 | 0.811603 | 0.867093 | 0.795 | 0.322 |
yolov8x | 1 | 0.825183 | 0.862620 | 0.793 | 0.317 |
Compute Infrastructure
Hardware
NVIDIA V100 GPU with 32GB of memory, hosted on computing nodes of Puhti supercomputer by CSC - IT Center for Science, Finland.
Software
Models were trained as Slurm batch jobs in Puhti.
Citation [optional]
BibTeX:
TBA
APA:
TBA
Model Card Contact
Janne Mäyrä