Skip to content

Scripts to train algorithms to detect fish, using underwater images labelled by citizen scientists in Spyfish Aotearoa

License

Notifications You must be signed in to change notification settings

wildlifeai/FishDetection-FasterRCNN-project

Repository files navigation

Spyfish Aotearoa - FishDetection with FasterRCNN

This repository contains scripts and resources to train machine learning algorithms to identify fish for Spyfish Aotearoa using data labelled by citizen scientists.

Adi Gabay and Ohad Tayler carried out this work, as part of their internship in Wildlife.ai and their studies in the Hebrew University.

Contributors Forks Stargazers Issues MIT License

Overview

To train the fish identification models we used still images of baited underwater videos (BUV). BUV is a simple, versatile underwater survey method that researchers use to count scavenger fish inside and outside marine reserves.

Citizen scientists labelled the images at Spyfish Aotearoa Zooniverse project. Using the Koster data mangament tools, we aggregated the labels of multiple citizen scientists and retrieved the data in a folder with the images and a folder of the labels in YOLO format.

We trained a 'FasterRCNN' using the pipeline below on the data to detect three fish species (blue cod, snapper and scarlet wrasse). We used methods like augmentations, style transfer to improve our model results.

Flow chart of the pipeline

Requirements

  • Python 3.7+
  • GPU with at least 16 GB of memory
  • CUDA - vesion 11.0.2
  • Trainig data (COCO format).

How to use

  1. In order to train the model you should run the train.py with the required parameters.
  2. To test the model you should run the file test.py
  3. In order to load the data and transform the data you should run the SpyFishAotearoaDatahandler - this should create a folder with the formatted data and the CSV files.
  4. To get general information about the data you should run the file utils/eda_lib.py
  5. To transfer the data style you need to use the utils/transfer_dataset
  6. To plot the images with the labels you should run the file plot_boxes_on_images.py

Citation

If you use this code or its models, please cite:

Gabay A, Taylor O, Paz E, Hyams G, Anton V (2022). Spyfish Aotearoa - FishDetection with FasterRCNN. https://github.com/wildlifeai/FishDetection-FasterRCNN-project

Collaborations/questions

We are working to make our work available to anyone interested. Please feel free to contact us if you have any questions.

About

Scripts to train algorithms to detect fish, using underwater images labelled by citizen scientists in Spyfish Aotearoa

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages