Tracking animals with particles

Post provided by Edward Lavender, Andreas Scheidegger, Carlo Albert, Stanisław W. Biber, Janine Illian, James Thorburn, Sophie Smout, Helen Moor.

It’s morning on Scotland’s west coast. In the Firth of Lorn, the deep-blue water sparkles in the early sunlight. Heading south, I glance back across the sea, taking in the snow-speckled mountains beyond. Two hundred metres below, I know the seascape is just as rugged. We reach our destination. The vessel’s anchor is deployed, the fishing lines are baited and I watch them slip into the deep. There’s a moment’s silence to reflect. Suddenly, a rod dips and the team springs into action. It’s go time.

Figure 1. Scotland’s magical Firth of Lorn.

This is the setting that inspired our recent animal-tracking papers. For years, we have been tracking the Critically Endangered flapper skate (Dipturus intermedius) in Scotland. Once widely distributed in northwestern Europe, flapper skate was fished nearly to extinction. Scotland’s west coast became a critical refuge and a Marine Protected Area was designated in the region for skate conservation. The questions faced by researchers in these situations are simple. Where do the animals go? How much time do they spend in different areas? And how can we leverage this information for conservation?

In Scotland, we catch skate via rod-and-reel, take photographs, conduct health assessments and tag individuals using electronic tracking devices, especially acoustic transmitters and archival tags. This process provides invaluable data supporting skate conservation. The acoustic transmitters release ‘pings’ every couple of minutes that are recorded by static underwater hydrophones when skate move within range. The archival tags record individual depths at regular intervals.

Figure 2. A flapper skate is released following tagging. Photograph sourced from Lavender et al. (2021). © Lisa Kamphausen/NatureScot.

A core component of our research involves developing integrative methods that leverage these kinds of animal-tracking datasets to estimate individual locations, which are not directly observed. Such estimates provide a foundation for studies of individual movements, habitat preferences, social interactions and conservation requirements.

It’s all a bit fishy

It turns out that it’s not all that easy. In fact, we’ve been working for years on this problem and new avenues of research keep developing.

In acoustic telemetry systems, the conventional approach has been to apply heuristic methods: using detections, we interpolate ‘pseudo’ locations between hydrophones and then smooth those positions over space to generate heatmaps. Another option is to formulate a statistical (‘state-space’) model for the locations of an animal through time and then perform inference for that model. This approach enables us to leverage our biological knowledge and integrate diverse datasets (such as detections and depth observations) in analyses. The model represents individual movements and how observations arise, contingent upon the individual’s location. The process of inference (or ‘model fitting’) then leverages the data and these contingencies to infer individual locations and quantify uncertainty.  

Evolution at the beach

Various inference algorithms exist. Filtering algorithms are one option and in our methods paper we developed the use of particle filters for animal tracking. Here’s the intuition.

The goal is to estimate an animal’s locations through time. We don’t observe locations exactly, so we’ll represent our knowledge using probability distributions. And we’ll build up a picture of those distributions using particles. Particles are like grains of sand. If you have enough, you can represent complicated shapes. In a particle filter, we sequentially sample particles (locations) in such a way that locations that are more likely, given the data, are sampled more frequently than those that are unlikely. This process generates heaps of particles in areas where the animal is likely to have been located and fewer particles elsewhere.

It’s a blind, branching process of evolution by natural selection. Think of particles for a moment not as positions, but as individuals in a population of hypothetical fish that is evolving. The filter comprises a series of time points, or ‘generations’, that span the duration of our observations. At each point, each hypothetical fish can move into a new location (mimicking how a tagged animal could behave, if it was in that location). Fish that move into locations compatible with the data have a high fitness and reproduce; others are killed. At each time point, the spatial distribution of surviving fish approximates our probability distribution for the location of a tagged animal. Thus we climb Mount Improbable.

Figure 3. Particle algorithms represent our knowledge of an individual’s location with a cloud of particles.

There is a challenge here: evolution has no foresight. This means that particles can get stuck down evolutionary dead ends, especially in complex landscapes. Maybe our particles spread two ways around an island, only one of which is ultimately compatible with the data. Particle smoothing solves this.

Smoothing is like pruning. We run back through our particle time series, cutting out dead ends (and occasionally forging new connections). This process produces a set of smoothed particle samples that embody all information from the past (hindsight) and the future (foresight). Simulations show that this statistical approach outperforms common heuristic methods across the board.

Pitter-patter

Our patter (R) and Patter.jl (Julia) packages implement the algorithms. Key package features include accessibility, flexibility and speed. The speed of the R package comes from the Patter.jl backend. Coupling R and Julia is fairly new, and not entirely straightforward (!), but an exciting area for the development of performant R packages that don’t sacrifice accessibility or flexibility. For passive acoustic telemetry, patter is also one of the few options suitable for direct use by practitioners that provides probabilistic estimates of individual locations (check out Wahoo.jl for another option). We hope this work will support research into the ecology and conservation of many species.

Figure 4. The patter R package fits state-space models to animal tracking datasets using particle algorithms. 

Get involved

Want to learn more? Check out the papers (method, application), or get started with the packages on GitHub. Please reach out with queries!

Post edited by Sthandiwe Nomthandazo Kanyile.

Leave a comment