Shaun Jagshi

All projects

Identity tracking for cichlid social behavior

Quality control for multi-animal tracking with idtracker.ai

Stage
In progress
Kind
Research software workflow
Where
Hofmann Lab, UT Austin
When
Since fall 2026

Running, checking and repairing multi-animal tracking so that later behavioral analysis can trust which fish is which.

end of one segmentstart of the nextboundary?
Fig. 1. Illustration of the boundary problem, not lab data. Identities hold within a segment, but labels have to be matched across the cut. Solid links are confident matches. Dashed links are unresolved.

The question

To study social behavior in a group you need each animal's trajectory, and each trajectory has to belong to the same animal from the first frame to the last. Fish cross, hide behind each other and swim close together, and every one of those moments is a chance for a tracker to swap two identities.

A swapped identity does not look like an error. The trajectories stay smooth. The output just assigns one animal's behavior to another, which is why the checking matters as much as the tracking.

Approach

I use idtracker.ai, an existing open-source tracker, and treat its output as something to verify. I look at detection and segmentation quality first, then at identity: where trajectories fragment, where two animals cross, and where the tracker's own uncertainty is high.

Long recordings are tracked in segments. Within a segment the identities are consistent, but nothing guarantees that a label means the same fish in the next segment, so the boundaries get their own review.

What I built

Most deep learning tooling assumes NVIDIA hardware. The lab's server uses AMD GPUs, so the tracker's PyTorch backend runs through ROCm, and I keep the run configuration written down so that a tracking pass can be repeated.

  • Tracking passes run per segment with a recording-specific background.
  • Boundary review scripts that compare the end of one segment with the start of the next and render short MP4 clips for visual checking.
  • Validation scripts in Python with NumPy and h5py that read trajectory files and check continuity.
  • Quality-controlled trajectories exported as time series for later analysis of swimming speed, nearest-neighbor distance, shoaling and group structure.
  • A GPU environment on a UT Austin server with AMD Instinct MI100 GPUs: Ubuntu, ROCm 6.3.1, PyTorch ROCm builds, Python 3.12, idtracker.ai 6.0.14 and conda.

How I checked it

Review is scripted and visual together. At each segment boundary I compare candidate identity matches and watch the rendered clips. Some cross-boundary matches are strong candidates. Others are still unresolved, and I have not yet concatenated a full recording with identities I would vouch for.

These are internal workflow checks. They are not a peer-reviewed validation, and they are not proof that every identity is correct.

What remains

Resolve the remaining boundary matches and concatenate full recordings. Keep experimenting with session configuration, segment boundaries and correction workflows to make the tracking more robust. The behavioral analyses that sit on top of the trajectories are still developing.

No lab footage or data appears on this site. The moving figure on the home page is a simulation.

Tools

Python, idtracker.ai, NumPy, h5py / HDF5, PyTorch (ROCm), conda, Ubuntu