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.
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.
- Python 3.7+
- GPU with at least 16 GB of memory
- CUDA - vesion 11.0.2
- Trainig data (COCO format).
- In order to train the model you should run the train.py with the required parameters.
- To test the model you should run the file test.py
- 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.
- To get general information about the data you should run the file utils/eda_lib.py
- To transfer the data style you need to use the utils/transfer_dataset
- To plot the images with the labels you should run the file plot_boxes_on_images.py
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
We are working to make our work available to anyone interested. Please feel free to contact us if you have any questions.