Just like human fingerprints, no two shy sharks have the same pattern of spots and stripes! We use these unique markings to identify individuals in our Snorkel for Science adventure.

Trying to match a shy shark by its spots is like playing an underwater game of “Where’s Wally?” (or “Where’s Waldo?”, depending on where you’re from) —except Wally keeps swimming away, and you have to hold your breath! Also Wally is a shark. …Alright, maybe it’s nothing like “Where’s Wally?” But who doesn’t love the challenge of a good puzzle, and in many ways, that’s what we have!

The puffadder shyshark

The puffadder shyshark, Haploblepharus edwardsii, is a harmless shark found only along the coast of South Africa, named for it’s resemblance to a snake with similar coloration. Affectionately nick-named “Happy Eddie”, this commonly encountered shark is a favourite amongst divers and snorkelers in False Bay and is now recognised as endangered by the IUCN Red List. The species is easily identified by it’s distinct orange “saddles” and many small white spots covering its dorsal surface, which we use to identify individuals in our Fin Spotter project.

We’ve observed that these spots can change over time, but are stable enough to use as “fingerprints” for identification.

How does it work?

It all begins with a photograph. Doing this in the water would not be easy!

Side-by-side, you might quickly recognize that these two images are of the same shark. So perhaps the puzzle is more similar to a game of “spot the difference”!

20 April 2024
25 May 2023

Certain areas of the shark tend to be more useful for identification than others. I find my eyes are drawn first to the pectoral fins, where individuals usually have a small number of distinct spots, surrounded by negative space that helps me focus on the shape of the spots. Compare this to some of the busier areas like the head where it can be difficult to compare the small densely packed spots. Another useful area for me are the shapes inside the orange saddles and darker regions. I find I also assign familiar descriptions to some of the shapes I see. Do you see a “cool S” in this one?

Speeding things up

As much as I love a good Magic Eye puzzle, comparing all the images in our database like this would quickly make your eyes cross. As the size of our database grows, the number of comparisons we might need to make grows exponentially. Without any kind of indexing strategy, brute-forcing these comparisons would be computationally intractable. Early methods for matching fingerprints at crime scenes overcame this by developing a classification system that partitioned the search space hierarchically based on pattern types, assigning numeric values to fingerprints to allow rapid lookup.

Fortunately these days we can employ the assistance of software to cut down on the work for us, but the process is very similar!

Describing features

Computer vision algorithms like the Hessian-Affine region detector work by identifying corners, which can be useful reference points to look for in images because they tend to remain corners regardless of changes in viewpoint or illumination. A second algorithm then translates the area around these keypoints into a description, a sequence of numbers called a vector or embedding. This is not so different to how we describe some of our spots as more familiar shapes. But now, with a numerical representation of a spot, we can also calculate exactly how similar two shapes are to one another!

We can draw on language models for a famous example that illustrates the concept of an embedding. Here, the relationship between the embeddings for the words man and woman is similar to the relationship between the words king and queen! Spots that are similar in appearance, should end up in the same region of our embedding space. The “most similar” spot will be the closest!

Nowadays, we can take this a step further and train machine learning models to calculate an embedding that represents the unique patterns of a whole individual.

Matching Individuals

Regardless of whether we have descriptions of a bunch of spots, or of our entire individual, we can now perform a similarity search against our database of spots or individuals. Approximate nearest neighbour algorithms that can index and compress vectors allow for fast searching through billions of records.

If the photo is of a shark we’ve seen before, it should match to an earlier photo in our database, and if not, perhaps we’ve seen someone new! About 25% of the sharks in our database have been seen on more than one occasion. Would you like to help us spot these cute sharks? Join a Snorkel for Science trip today!


Dylan Irion

Dylan is a marine scientist and Save Our Seas Foundation project leader, working towards a PhD that aims to unravel the drivers of white shark population dynamics in South Africa. He is a passionate freediver and SCUBA diver, and volunteers as a Sea Rescue crew member.

0 Comments

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.