CoolFace
Modelpublic

mayrajeo/marine-vessel-detection-yolov8

sourceHugging Faceagpl-3.0updated 1y agoView on Hugging Face
8likes113downloads
Model Card

Model Card for YOLOv8 models for detecting marine vessels from RGB Sentinel-2 images

<!-- Provide a quick summary of what the model is/does. -->

This model is mostly obsoleted, use https://huggingface.co/mayrajeo/marine-vessel-yolo instead.

Model Details

Model Description

<!-- Provide a longer summary of what this model is. -->

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 are available as GeoPackage files on Zenodo portal: https://zenodo.org/records/10046342.

  • —Developed by: Janne Mäyrä
  • —Model type: Object Detection
  • —Finetuned from model: YOLOv8 pretrained models

Model Sources

<!-- Provide the basic links for the model. -->

Uses

<!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->

Direct Use

<!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->

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

<!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->

These models are not suitable for other purposes than for detecting potential marine vessels from satellite imagery.

Recommendations

<!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->

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

<!-- This should link to a Data Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->

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.

The annotations are available as GeoPackages on Zenodo portal: https://zenodo.org/doi/10.5281/zenodo.10046341

Training and validation data:

LocationDateNumber of annotationsAnnotated patchesBackground patches
Archipelago sea2022-06-19519271269
Archipelago sea2022-07-211518387153
Archipelago sea2022-08-131368402138
Gulf of Finland2022-06-06278138241
Gulf of Finland2022-06-261206269110
Gulf of Finland2022-07-21971260119
Bothnian Bay2022-06-271228188
Bothnian Bay2022-07-121629871
Bothnian Bay2022-08-289868101
Training Hyperparameters

Training configs can be found from each model directory, in the file args.yaml.

Evaluation

<!-- This section describes the evaluation protocols and provides the results. -->

Testing Data, Factors & Metrics

Testing Data

<!-- This should link to a Data Card if possible. -->

Test data consists of six Sentinel-2 mosaics:

LocationDateNumber of annotations
Bothnian sea2021-07-14450
Bothnian sea2022-06-24424
Bothnian sea2022-08-13399
Kvarken2022-06-1783
Kvarken2022-07-12183
Kvarken2022-08-2688
Factors

<!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->

Before evaluating, the predictions for the test set are cleaned using the following steps:

  1. 1.All prediction whose centroid points are not located on water are discarded. The water mask used contains layers jarvi (Lakes), meri (Sea) and virtavesialue (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.
  2. 2.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.
  3. 3.All predictions that contain an above water rock within the bounding box are discarded. The mask contains classes 38511, 38512, 38513 from the layer vesikivi in the Topographical database.
  4. 4.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
  5. 5.All predictions that are wind turbines, found in Topographical database layer tuulivoimalat
  6. 6.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

<!-- These are the evaluation metrics being used, ideally with a description of why. -->

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')
yolov8n0.846880.823160.812730.795870.7839280.768950.388160.3808280.376370.843230.8271920.81776
yolov8s0.863630.8345560.808350.836390.8255540.814690.410980.4062580.403740.869330.8586320.84776
yolov8m0.835920.8279380.811340.849390.832380.801530.417390.4107420.404960.870710.8603780.84545
yolov8l0.85450.8469980.839730.849750.830720.823980.416940.4117120.405050.874590.8633340.85743
yolov8x0.840280.8347280.830190.848910.8284620.808580.420650.4115320.402310.862030.8581360.85131

Models with best performance for test set for each model architecture:

ModelFoldPrecisionRecallmAP50mAP
yolov8n10.8208060.8384520.8420.403
yolov8s40.8444850.8605650.8650.422
yolov8m40.8588660.8746930.8800.453
yolov8l10.8409090.8636360.8620.443
yolov8x10.8557460.8599510.8760.450

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]

<!-- If there is a paper or blog post introducing the model, the APA and Bibtex information for that should go in this section. -->

BibTeX:

@misc{mayraMappingRecreationalMarine2024,
  type = {{{SSRN Scholarly Paper}}},
  title = {Mapping Recreational Marine Traffic from Sentinel-2 Imagery with Yolov8},
  author = {M{\"a}yr{\"a}, Janne and Virtanen, Elina and Jokinen, Ari-Pekka and Koskikala, Joni and V{\"a}kev{\"a}, Sakari and Attila, Jenni},
  year = {2024},
  doi = {10.2139/ssrn.4827287},
}

APA:

Mäyrä, Janne and Virtanen, Elina and Jokinen, Ari-Pekka and Koskikala, Joni and Väkevä, Sakari and Attila, Jenni, Mapping Recreational Marine Traffic from Sentinel-2 Imagery with Yolov8. Available at SSRN: https://ssrn.com/abstract=4827287 or http://dx.doi.org/10.2139/ssrn.4827287

Model Card Contact

Janne Mäyrä