Skip to main content Skip to secondary navigation
Main content start

From pixels to protection: Drones offer a high-tech lifeline for shark conservation

A novel machine learning pipeline developed by a Stanford student team is accelerating analysis of aerial drone imagery – and monitoring of an endangered shark species.

Video by Madison Pobis and Stanford Student Robotics

Shark conservation has a new high-tech ally. Working in Costa Rica, a Stanford Student Robotics team analyzed drone footage of endangered Pacific nurse sharks (Ginglymostoma unami) using machine learning to identify animals swimming at a coastal site and calculate body measurements like length and width. These measurements can help provide insight into overall population health and inform conservation efforts.

“To me, the beauty of the trip was introducing Stanford engineers to marine biology – bringing talented difference-makers together to solve problems that matter,” said Dakota Riemersma, ’25, one of the leaders of the field team and a coterminal master’s student in civil and environmental engineering, a joint department between the Stanford School of Engineering and Stanford Doerr School of Sustainability.

Inspired by the possibility of combining robotics, drone flight, and computer science to solve ocean science problems, the team initiated a collaboration with researchers from Universidad de Costa Rica (UCR). Their field mission to pilot drones, record aerial imagery, and support nurse shark tagging efforts was supported with funding from the Mel Lane Student Grants Program through the Stanford Woods Institute for the Environment.

The results of their machine learning pipeline, which are detailed in a study published September 2024 in the Proceedings of the European Conference on Computer Vision, suggest that their approach could streamline the process of translating aerial drone imagery to shark biometrics by up to 91% compared to manual analysis – a critical improvement for monitoring an ocean ecosystem under threat.

Questions emerge about a new species

A Pacific nurse shark underwater
A Pacific nurse shark (Ginglymostoma unami). (Image credit: Sergio Madrigal-Mora)

At first glance, a nurse shark could be mistaken for a massive catfish with its brownish skin, toothless grin, and mustache-like barbels (sensory whiskers that help them find food along the seafloor). Despite what their innocuous appearance might suggest, these sharks are important predators critical to maintaining healthy coastal ecosystems. For roughly the last century, scientists assumed that there was only one species of nurse shark (Ginglymostoma cirratum), which could be found in both the Atlantic and Pacific Ocean.

In 2015, researchers analyzed tiny variations in nurse shark body features, revealing that the Pacific nurse shark is a distinct endangered species which inhabits the tropical Pacific Ocean along the coast of Latin America.

Pressure from unmanaged fishing and the degradation of key habitats, like mangroves, has drastically reduced the Pacific nurse shark population since the 1990’s. Sergio Madrigal-Mora, formerly a master’s student at UCR and CSU Long Beach and now a PhD candidate at Flinders University, has been working to characterize the habitat and behavior of the sharks. Madrigal-Mora is particularly interested in understanding how Pacific nurse sharks may be reacting to warmer ocean temperatures and habitat degradation.

“Studying how Pacific nurse sharks respond to changes in water temperatures functions as a model and foundation for better understanding of how sharks and other large ectothermic or ‘cold-blooded’ fish will alter their behavior under climate change,” said Madrigal-Mora. “This is particularly important for endangered species that may move to areas where they will be more exposed to threats.”

Aerial drones create a window into a shark haven

Along the exposed coastline of Costa Rica, natural upwelling brings rich nutrients and cold water from the deep to the ocean surface. The confines of Santa Elena Bay, a marine protected area in northeastern Costa Rica, create pockets of shallow, warm water where the sharks come inland to congregate, possibly to regulate their body temperature. The clear, shallow water also makes it a prime location to study their undisturbed behaviors with aerial drones.

Aerial view of an aggregation of Pacific nurse sharks in shallow water.

An aggregation of Pacific nurse sharks in Santa Elena Bay, Costa Rica. (Image credit: Sergio Madrigal-Mora)

The ocean is notoriously difficult to study from above. Satellite imagery is limited by water depth and animals move freely across wide expanses. “Drones are relatively cheap and accessible tools for marine research when compared with the expensive array of buoys, tags, and transmitters typically needed to track an animal population through the ocean,” said Mark Leone, ’25, a coterminal master’s student in mechanical engineering.

Over the last few years, Madrigal-Mora and his colleagues have collected aerial drone imagery to supplement more traditional tracking methods like acoustic and PIT tags, but manually parsing through hours of raw video to extract meaningful data was slowing down the process.

Jaden Clark, BS ’24, MS ’25, had worked with Mario Espinoza, a professor of biology at the Centro de Investigación en Ciencias del Mar y Limnología at UCR and senior author of the paper, while volunteering with a research lab he connected with in high school. He suggested that Stanford Student Robotics may have the unique combination of robotics and computer science skills to fill in the gaps.

Aerial view of a nurse shark with overlaid graphic mask showing outline.
The machine learning pipeline analyzes drone imagery to create an outline of a shark in motion. (Image credit: Stanford Student Robotics)

Taking previous machine learning pipelines a step further, the team wanted to create a process that would extract outlines of the sharks from the imagery. With a more detailed view of these body dimensions and their surrounding environment, researchers can extrapolate metrics like how fast a shark is moving, how fast it is beating its tail, and rough estimates of energy expenditure, which contribute to a more holistic picture of how the animals are operating within the marine ecosystem.

“Right now one of the major bottlenecks in this field is the time it takes to manually process and analyze recorded data, significantly hindering efficiency and workflow,” said Chinmay Lalgudi, BS ’24, MS ’24, who worked on the computer model in the study. “What we were able to demonstrate is that our machine learning pipeline could significantly reduce the time it takes to get results from the drone footage. That’s good news for folks who need as much information as possible to inform conservation efforts.”

Ultimately, the team hopes to simultaneously run their model during drone flights in the field, employing a YOLO, or You Only Look Once, framework that offers further pathways to more efficiently and effectively study ocean ecosystems under pressure from human activity.

The power of the field trip

This Stanford Student Robotics team hopes that by involving first-year undergraduates and sophomores in hands-on field work, they are exposing students to opportunities beyond the typical pipeline that funnels computer science students to careers in the technology industry.

“This experience has been really transformative and a great way for me to learn how to apply a lot of the skills that I’ve acquired in the classroom where I strictly sat behind a computer and worked with data that other people had collected,” said Sonnet Xu, ’27, a sophomore in computer science.

Jayson Meribe, ’26, and Andy Tang, ’26, also contributed to the research.

Explore More