Skip to content

vaibhavgp69/Fish-Behavior-Analysis

Repository files navigation

Fish Behavior Analysis in Aquaculture

This project focuses on analyzing fish behavior in aquaculture to optimize fish growth and health. Using a custom-trained YOLOv10s model, fish are detected and tracked to study their feeding interactions. By leveraging methods such as tracking and Delaunay triangulation, the feeding behavior of fish is classified. The analysis addresses issues like ammonia buildup, reduced growth, and aggression among fish. The dataset, annotated from scratch, provides the foundation for training the model, leading to improved accuracy and stable detection. The model training and inference were performed using the PyTorch library on an NVIDIA GeForce RTX 4060 Ti GPU with 16GB VRAM, ensuring efficient processing and fast computations. Key metrics like average speed, flocking index, triangle area, and edge length are calculated to assess fish behavior comprehensively.

Problem Statement: Need for Efficient Behavioral Analysis

  • Ammonia Buildup
  • Reduced Fish Growth and Health
  • Aggression Among Fish

Solution

A custom-trained YOLOv10s model is used to detect fish. Methods like tracking and Delaunay triangulation classify the feeding behavior of fish.

Dataset

The dataset has been completely annotated from scratch.

Dataset Link

Instructions to Run the Code

  1. Open the gpu-train-yolov10-trial.ipynb file.

  2. Create a conda environment using the commands:

    conda create env -o pt python=3.10
    conda activate pt
    pip install -r requirements.txt
  3. Run the code from the notebook. Use the dataset link to load the dataset for training if needed or refer to the data links provided in ./data/data_link.md and ./Feeding_data/feeding_data_link.md.

GPU Used

image

Fish Detection & Analysis Results

Object Detection

20240718-1444-56 6404381-ezgif com-video-to-gif-converter

Tracking

tracking

Delaunay Triangulation

delauney

Results

Training Results for Different YOLOv10 Models (S to L)

  • The accuracy results were best for the YOLOv10_small version for our dataset and size.

image image

Training on Custom Dataset

  • Trained custom data on the YOLOv10 small model.
  • Observed better accuracy metrics and stable detection, initial loss convergence, followed by increased validation bounding box loss.
  • Multiple epochs were run, and the best model in these epochs was saved.

image image

Analyzing the Data

  • Average Speed: Determining the mean speed of the fish within each tank.
  • Average Flocking Index: Measuring the degree of cohesive movement and interaction among the fish.
  • Average Triangle Area: Calculating the average area formed by triplets of fish, indicating spatial distribution.
  • Average Edge Length: Assessing the average length of edges connecting fish, reflecting the overall density and spread.

image

  • Flocking Index is higher for well-fed fish since they group together more, while hungry fish search for food and are separated.
  • Average Triangle Area provides information about how spread out the fish are, despite their grouping or flocking index.

image

  • Less difference in Edge Length since it is subjective to individual fish.
  • Hungry fish are more explorative, hence higher speed values are observed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published