This repository contains the code and analysis workflow for the paper "Fine-scale spatiotemporal predator-prey interactions in an Antarctic fur seal colony". It includes the neural network training pipeline (YOLO-based) and the downstream ecological analysis of predator-prey spatial dynamics.
Density critically shapes population dynamics, with high densities exacerbating intraspecific competition and disease transmission, while low densities increase predation risk. To investigate spatiotemporal density patterns and predator-prey interactions in an Antarctic fur seal (Arctocephalus gazella) colony, we deployed an autonomous camera that captured minute-by-minute high-resolution images throughout a breeding season. Using a YOLO-based neural network, we identified adult males, females and pups, and avian predator-scavenger species: giant petrels (Macronectes spp.), brown skuas (Stercorarius antarcticus) and snowy sheathbills (Chionis alba). Analysing a dataset of 4.1 million automated detections from over 10,000 high-quality images, we found spatiotemporal abundance patterns corresponding with the known foraging and breeding behaviours of these species. Strong temporal associations also emerged between the abundance of pups and two of the avian species. Fine-scale spatial analyses further revealed that pups typically remained near other pups and adult females but avoided avian predators and territorial males. Notably, the proximity of adult fur seals of both sexes reduced pup predation risk, defined as the distance between the pup and the nearest bird, whereas proximity to other pups did not. This study provides a framework for studying density-dependent interactions in wild populations and highlights the value of remote observation in ecological research.
Ane Liv Berthelsen 





- Python: 3.8.10
- python packages listed in requirements.txt
- Hardware: NVIDIA GeForce RTX 3070 (8GB VRAM)
- CUDA Toolkit: 11.2 (Required for reproducibility)
- NVIDIA Driver: 575.51 (Supports CUDA 11.2+)
- Clone the repository:
git clone https://github.com/fabrylab/AntarcticFurSealPredatorPrey.git cd AntarcticFurSealPredatorPrey - Install dependencies:
pip install -r requirements.txt
Note: The data annotation was performed using ClickPoints.
To reproduce the results, you must first download the dataset and pre-trained weights from Zenodo.
- Download Data:
- Go to 10.5281/zenodo.18141470
- Download
data.zip,model.h5,automated_detections.csv andmanual_detections.csv.
- Unpack:
- Unzip
data.zipinto the repository root. - Place
model.h5in the repository root. - Place
automated_detections.csvandmanual_detections.csvin the files folder
- Unzip
- Directory Structure:
Ensure your folder looks like this:
. ├── data/ # Unzipped image dataset │ ├── image.JPG │ ├── image.cdb # ClickPoints database files │ └── ... # Remaining images and databases ├── files/ # Detection data │ ├── automated_detections.csv │ └── manual_detections.csv ├── assets/ # Documentation images (optional) │ └── cover.png ├── model.h5 # Neural network weights ├── train.ipynb # Training pipeline ├── analyze.ipynb # Ecological analysis ├── requirements.txt # Python dependencies └── README.md # Project documentation
Run this notebook to retrain the network or finetune the model.
- Follow the comments provided within the notebook.
- Ensure the data directory is correctly linked.
This notebook contains the entire ecological data analysis presented in the paper.
- Generates the spatiotemporal plots and predator-prey interaction statistics.
- Input: The detection data (CSV/dataframe) produced by the network.
For questions regarding the code, dataset, or the biological analysis, please contact the authors:
If you encounter bugs in the code, please feel free to open an issue in this repository.
