field notes — no. 04 / 04 for Elk Valley Resources

ReID

Re-identifying individual westslope cutthroat trout from photographs

Westslope cutthroat trout carry a pattern of black spots on their flanks that differs from fish to fish. A photograph taken when a fish is caught can therefore serve as its tag. We built a pipeline that takes such field photographs, straightens and cuts out the fish, and compares its spot pattern with every fish already in the database. For the Elk River in British Columbia, the true recapture was the top match in 98% of the 2023 photographs. A person checks the best matches before they enter the record.

for Elk Valley Resources
Ongoing

A westslope cutthroat trout in a perspex chamber with a ruler, on the gravel bank of a mountain river

A westslope cutthroat trout in a perspex chamber at the riverbank, photographed for identification before release.

Elk Valley Resources

the story

The problem, and what is needed

Much of what we want to know about a fish population depends on recognising individuals: how many fish there are, how fast they grow, how far they move and how many survive from one year to the next. Mark-recapture studies answer these questions by catching fish, marking them and counting how often marked fish turn up again.

In trout the mark is usually a PIT tag, a small transponder injected into the body cavity. Tagging means catching and handling every fish, and reading the tag requires a scanner. Small fish are not tagged because the risk to the fish is too high, so the youngest size classes are hardly followed at all.

The westslope cutthroat trout (Oncorhynchus clarkii lewisi) is assessed as Special Concern in Canada by COSEWIC, because of habitat loss, competition and hybridisation with rainbow trout, and overexploitation. In the upper Fording River in the Elk Valley, the number of subadult and adult fish collapsed in 2019, and the population has been monitored intensively since.

The species offers an alternative to tagging. The black spots on the flank form a pattern that differs between individuals, and between the left and right side of the same fish. If that pattern can be read reliably from ordinary field photographs, a photograph can replace the tag.

The fish already carries its own mark.

Photographs can come from monitoring crews, but also from anglers and fishing guides.

“A photograph taken at capture can do the work of a tag.”

A westslope cutthroat trout lying straight in a white measuring trough over a blue tub

A good identification photo: left side, taken from straight above, evenly lit, with the fish straight on a plain background.

Elk Valley Resources

A westslope cutthroat trout in a measuring trough over the mesh of a landing net

The mesh of a landing net is a regular pattern that makes it harder for the software to separate the fish from its background.

Elk Valley Resources

method

What we do, and what it changes

Field photographs vary in angle, light and background, so each one is first normalised. A detection model finds the fish, a pose model locates seven points on its body (the eye, the bases of four fins and the top and bottom of the tail) and the image is rotated so that the fish lies horizontally. The fish is then cut out and placed on a black background, so that nothing but its own pattern is compared.

On the cut-out fish, a keypoint extractor marks several hundred distinctive points of the spot pattern and records the position and appearance of each. These are stored in a database of individuals. A matching model, LightGlue, compares the keypoints of a new photograph with those of every fish in the database and scores how well they correspond.

The extractors need no training on trout, which matters because most fish in a monitoring dataset are photographed only once or twice. We tested four of them; all performed well, with SIFT slightly behind the others.

We tested the pipeline on photographs of PIT-tagged fish from the Elk River, taken in 2021 to 2023, in which the tag gives the true identity of every fish. The 2021 photographs were too poor to use. For 2023, the true recapture was the best match in 98% of cases, and for 2022 in 92%. Part of the 2022 shortfall came from errors in the tag records themselves, such as one tag number assigned to two different fish.

The model reports how similar two fish are, not who a fish is. A web application shows the five best matches for each photograph, with the matching spots drawn between them, so that a person can confirm a recapture or record a new individual.

For 2023, the true recapture was the best match in 98% of cases.

Comparing a new fish with a database of about 2,750 individuals takes about a minute on a single GPU, and around fifty times longer on a CPU.

Two photographs of a westslope cutthroat trout cut out on a black background, with green lines joining matching spots

Matching spots between two photographs of a westslope cutthroat trout, after both have been rotated and cut out. Each green line joins the same spot in both images, despite differences in light and colour.

Lumax, from photographs by Elk Valley Resources

in hindsight

What we learned

Once a fish is well photographed, matching is the easy part. Nearly all failures trace back to the photograph: a fish out of focus, partly submerged or strongly curved, or photographed on its right side when the database holds its left.

We therefore wrote photo guidelines for field crews: photograph the left side (or both sides) from straight above, keep the light even, use a plain background, let the fish fill most of the frame and take several photographs. The guidelines also state that a suboptimal photograph is better than none, and that the welfare of the fish comes first.

The matching also checks the existing records. A fish that matches strongly with a different tag number points to an error in the tag data, not necessarily in the model.

The next questions are whether the method works for small fish, whose spot patterns change as they grow and which cannot safely be tagged, and whether underwater cameras can photograph fish well enough to identify them without catching them at all.

Once a fish is well photographed, matching is the easy part.

“The model reports how similar two fish are. A person decides whether it is the same fish.”

resources
Trout identification demo — match a trout photo against a catalogue of known fish
the other three stories