Behavioral Tracking Model for Captive Animals

By Sophia Mangrubang


Scientific Context

Behavioral observation and data collection is an integral part of maintaining animals in captivity. Large corporations, such as zoos, rely on staff members to observe animal behaviors as a means of assessing their health. However, without constant surveillance, key behavioral patterns can be overlooked. Machine learning provides a unique opportunity to reduce the time-commitment of staff, increase monitoring time, and produce visualizations that provide valuable insights.

Currently, there are a few major products that utilize machine learning methods for behavioral observation in captivity. These models are insightful, but lack the accessibility and customization of an open source model.

My dataset, consisting of Southern Sea Otter enclosure live feeds, will serve as an example of how scientists could use my model to gain behavioral information. From the model outputs, users can track, count, and study long term species patterns across multiple enclosures. These results can then aid in making care-related decisions.


Dataset Description

My dataset consists of 3 live feed videos of Southern Sea Otter enclosures. One video is from the Georgia Aquarium, and two are from the Monterey Bay Aquarium. The dataset consists of 348 raw images, and around 900 after the augmentations were added. Within all 3 videos, Southern Sea Otters are the only class present and there are 3 - 5 in each enclosure.

Within each enclosure, my 3 defined zones of interest are present. These zones are water, land, and seclusion. The enclosures are divided in this way to produce the most detailed tracking information possible for the model outputs.

Metadata:

Video 1:

Videos 2 & 3:


Model Selection

YOLOv11 Object Detection Model

I chose to use YOLOv11 to create a custom object detection model. The model was trained to detect the presence of Southern Sea Otters in water and on land. I chose an object detection model because it would allow me to add additional features to my model through supplementary code snippets. The features would produce additional visualizations to better interpret movement patterns and behaviors from the dataset. I manipulated the code found in our textbook to better identify and correctly label the otters in lower resolution cam footage, as well as in both land and water. These are my model parameters.

# Train the model
results = model.train(
    data=dataset_config, 
    epochs=100,
    batch=64,  
    imgsz=640,
    plots=True,
    patience=50,
    conf=0.55,
    iou=0.5
)

Additional Features: Ultralytics Objects Counting in Regions & Heatmap

Additionally, I utilized code from Ultralytics to produce an object counting in region video. I defined the 3 regions of interest (land, water, seclusion) through pixel coordinates over the input video, meaning the model was then able to differentiate between each zone and produce unique counts for each. I was able to manipulate the base code to track all 3 regions at once.

I also utilized Ultralytics’ heatmap code to display a heatmap on the input video, showing which regions of the enclosure were most frequently occupied. I specifically focused the heatmap on the land zone, where the otters were spending most of their resting time. I manipulated the code to focus on the land zone, using pixel locations to create a custom region within the video.


Model Assessment

Here are the metrics I used to assess the accuracy and performance of my model during training.

Confusion Matrix

The final confusion matrix shows that my model was very successful at identifying sea otters across the dataset. There are a portion of mislabels where the model mistook a sea otter for background, but this can be expected with the quality of training images and smaller dataset.
https://huggingface.co/OceanCV/Southern_Sea_Otter_Tracking/blob/main/confusion_matrix_final.png Confusion matrix from final run

F1 Score

The final F1 curve shows my model’s high precision and recall across the various confidence levels. The curve had a high peak, signifying a harmonic balance between precision and recall. https://huggingface.co/OceanCV/Southern_Sea_Otter_Tracking/blob/main/F1_curve.png F1 graph from final run

Object Detection Model Output

My final object detection output video was a key metric in assessing the performance of my model. I bounced between looking at the output video, assessing how accurate the bounding boxes and identifications were, and rerunning the model with modified parameters. My final model output was successful at identifying sea otters in both land and water, with minimal misclassifications or missed detections. The final video can be found in my respository or downloaded here.


Model Use-case

Example Proposal: Utilize the Behavioral Tracking Model to track and analyze the movement patterns of sea otters between water, land, and secluded zones to assess their interactions with their enclosure.

Example Hypothesis: Southern Sea Otters will congregate in the water zone most frequently and for the most time, and will rarely enter the seclusion zone.

Example Impact: Researchers found that sea otters spend the majority of their resting time on land, hidden behind objects (rocks, toy structures, etc.) and in the seclusion zone. They then modified the enclosure to provide more private spaces, such as large toys and structures, to create more secluded spaces.

Model Justification: My model would be a reasonable tool for initial data collection, providing species interaction data across zones, animal frequency, and areas of interest within the enclosure.


Disclaimer

Credit for all videos used in the dataset go to the Monterey Bay Aquarium and Georgia Aquarium.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for OceanCV/Southern_Sea_Otter_Tracking

Base model

Ultralytics/YOLO11
Finetuned
(42)
this model