How Python Programming Protects Endangered Snow Leopards

With around 5,000 individuals left, snow leopards were at risk of extinction in the wild. Referred to as the “ghost of the mountains”, snow leopards can camouflage amid their rocky habitats incredibly well, almost too much so. For years, the Snow Leopard Trust relied on cameras and people to monitor leopard activity. Specifically, in camera trap surveys, 200,000-300,000 photographs are taken from locations in areas spanning 800km² and analyzed manually. But often, the cameras tuned into random noise rather than capturing the elusive leopards. Clicking through blank photos wasted scientists’ time, and compromised accuracy, as human review was prone to causing errors in population estimates. Furthermore, snow leopards preyed on livestock, and local hunters would kill the leopards in defense.

To solve this issue, scientists began implementing python-based artificial intelligence (AI) tools to automate the leopard identification process. Microsoft engineers programmed machine learning into motion sensing cameras. Running leopard photos through AI, such as the open-source model MegaDetector can classify leopards at lightning speeds of up to 100-200 images per second. Thus, researchers no longer need to meticulously sort leopards from blank photos and other objects by hand.

Each leopard has a completely unique coat pattern, similar to human fingerprints. Previously, poor quality images and human error lead to leopards being counted multiple times, causing an overestimation of leopard populations. Now, AI algorithms can analyze leopard rosette patterns with much higher accuracy. Pose invariant embeddings, a method widely used in facial recognition technology, helps map different angles of a 3D object. In wildlife conservation, this protects against overestimations, even with inconsistent image quality.

How can technology protect the lives of both leopards and local farm animals? Beginning in 2022, solar-powered cameras were installed near inhabited areas. These cameras, powered by a Raspberry Pi python script, can detect leopards and other predators with 90-95% accuracy. Once predators are spotted, the technology automatically alerts villagers in the area. This turns potential attacks into preventative action.

Snow leopard numbers have rebounded in areas with high technology and warning system coverage, such as parts of Bhutan and India. Their status in the IUCN (International Union for Conservation of Nature) has transformed from Endangered to Vulnerable. Poaching, the illegal killing of wild animals for body parts, still affects leopard populations. However, recent leaps in AI software and detection technology can help scientists track vulnerable populations more closely and protect remaining species. Globally, over 49,500 species are threatened with extinction. But modern technology offers hope in preserving these species. By utilizing python-based technologies, scientists can better monitor and map populations, helping preserve biodiversity on Earth.

Citations:

Bohnett, E. (2025, June 18). AI helps tell snow leopards apart, improving population counts for these majestic mountain predators. Phys.Org. https://phys.org/news/2025-06-ai-leopards-population-majestic-mountain.html

Cunningham, S. (2026, May 15). Powering coexistence: How raspberry pi technology is helping WWF protect wildlife and communities in Pakistan. Raspberry Pi. https://www.raspberrypi.com/news/powering-coexistence-how-raspberry-pi-technology-is-helping-wwf-protect-wildlife-and-communities-in-pakistan/

IUCN. (2025). Background & history. IUCN Red List of Threatened Species. https://www.iucnredlist.org/about/background-history

Moshiri, A. (2025, May 28). New tech helping keep snow leopards safe in the wild in Pakistan. BBC Newsround. https://www.bbc.co.uk/newsround/videos/cd0l42jjzlyo

Trust, S. L. (2019, August 27). How AI helps US understand & protect snow leopards. Snow Leopard Trust. https://snowleopard.org/how-ai-helps-us-understand-protect-snow-leopards/

Leave a comment