Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Applying YOLOv8 to Kaggle Ships in Google Earth dataset

License

NotificationsYou must be signed in to change notification settings

robmarkcole/kaggle-ships-in-satellite-imagery-with-YOLOv8

Repository files navigation

This project demonstrates the training of bothYOLOv5 andYOLOv8 to perform detection of ships on a Google Earth dataset. Training is performed on a GPU machine but inference is on any CPU machine.

Dataset

The source dataset used is on Kaggle atShips in Google Earth. This dataset consists of images extracted from Google Earth which are approximately 30 to 50cm resolution. Images generally consist of a range of sizes of ship/boat against the blank ocean background, but some images are captured with ships close to the shoreline or with multiple clustered ships. Each ship is annotated with a bounding box in Pascal VOC (XML) format.

Annotation conversion

YOLOv5/8 requires images in a specific annotation format. To transform the annotations from Pascal VOC to YOLOv5/8 format I uploaded the dataset toRoboflow as Roboflow allows transormation of the annotations to the required format. I also rebalanced the dataset into train/validation/test splits with a 70%/20%/10% split (note these % change after augmenting the test images). I applied three augmentations to the training images which are appriate for aerial imagery: a horizontal flip and 2x rotations. This increased the training set size threefold to approximately 1.4k images. I also resized all images to 640x640 since this is the required size for the YOLOv8m model. This dataset is publicly availablehere

Training YOLOv5

Roboflow provide ready to use training notebooks, and I used theYOLOv5 notebook. The notebook is provided here in the fileyolov5_kaggle_ships.ipynb.

Training YOLOv8

I again used the RoboflowYOLOv8 notebook as my starting point. The notebook is provided here in the fileyolov8_kaggle_ships.ipynb. Training was performed on Google Colab Pro using a Tesla T4. The results of training for 100 epochs are below (yolov8n model):

Validation metrics

Metrics for the best models, which are in themodels folder:

Metricyolov8nyolov8m
Precision0.9190.943
Recall0.8630.927
mAP@.50.9410.957
mAP@.5:.950.6830.720

Reviewing the predictions on the validation set I observed some errors, particularly for small boats. Overall the results are very encouraging:

Reviewing the test predictions (see notebook), in general ships are accurately detected with high confidence but some small and very long ships are missed.

Training Summary

With relatively little time and effort I trained a YOLOv8 model for ship detection. For improved results, future work could include experimentation with larger models, and augmentation strategies could be explored to help balance out some of the variations due to sea conditions (rough or calm), lighting (overcast or bright sunshine), ship density. However the training dataset is very small, so simply gathering a larger training dataset would have the largest impact on performance.

Local inference

Theinference.ipynb notebook shows how to inference (process) images on a machine without GPU (I am on Intel Mac).

  • python3 -m venv venv
  • source venv/bin/activate
  • (venv) $ pip install -r requirements.txt
  • Using VScode openinference.ipynb

About

Applying YOLOv8 to Kaggle Ships in Google Earth dataset

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2026 Movatter.jp