Conservation Technology · Kenya 2025

AI-Powered
Wildlife Detection
in the Corridor

Automating camera trap analysis for the 14 km Mount Kenya Elephant Corridor — replacing a week of manual work with a pipeline that runs in minutes.

~5,000
Images annotated
91%
Elephant accuracy
3
Camera trap sites
14 km
Corridor monitored

A bottleneck in the heart of conservation

The wildlife corridor linking Lewa Wildlife Conservancy to Mount Kenya is one of northern Kenya's most ecologically significant landscape features — enabling free movement for elephants, Grevy's zebra, giraffe, and buffalo across an increasingly fragmented landscape.

Over 50,000 crossing events were recorded across all species in 2022 alone. Three camera traps continuously photographed this movement. The problem? Manually reviewing a single week's footage could consume up to a full week of staff time. Consistent analysis was nearly impossible to sustain at scale.

"Lewa's 2022 Annual Report identified AI-assisted image processing as a strategic priority — the detection model developed during this placement was built directly in response to that need."

The goal: replace manual review with an automated pipeline that could detect animals by species, classify direction of movement through the corridor, and export structured count data — all in a fraction of the time.

The Mount Kenya Elephant Corridor

Three camera trap sites positioned across the full 14 km passage, capturing movement between Lewa/Ngare Ndare in the north and Mount Kenya National Reserve in the south.

LEWA WILDLIFE CONSERVANCY + Ngare Ndare Forest Reserve MOUNT KENYA NATIONAL RESERVE A2 HIGHWAY 📷 UNDERPASS Site 1 · North 📷 MARIANA Site 2 · Mid-corridor 📷 MT KENYA EXIT Site 3 · South ← 14 km CORRIDOR → INTO Lewa ↑ OUT ↓

The detection pipeline

01

Data Collection & Annotation

5,000 camera trap images compiled from the three corridor sites, supplemented with Google Images for species diversity. Each image was manually annotated in Roboflow using bounding boxes — labelling animals at species level plus background objects (bushes, rocks) to improve robustness.

02

Model Training (Roboflow)

A custom YOLOv8 object detection model — lewa-elephants/3 — was trained on the annotated dataset. Roboflow handled preprocessing, training, and deployment, exposing the model via an API for programmatic access.

03

Python Batch Processing Script

A local Python script connected to the Roboflow API to process batches of images. Images were resized to max 1280px using Pillow, passed to the model, and predictions (species label, confidence score, bounding box coordinates) were returned for each frame.

04

Directional Movement Classification

A key design decision: the horizontal centre (x-position) of each detection's bounding box was tracked across sequential frames. Left-to-right movement classified as INTO Lewa; right-to-left as OUT OF Lewa. This prevented the same animal from being double-counted across frames.

05

CSV Export for Analysis

Final species-level IN/OUT counts exported to formatted_results.csv. Images with no detections skipped automatically. Data structured for longitudinal analysis and integration with Lewa's broader ecological datasets.

Model accuracy by species

Click a species to learn more about detection challenges and performance.

Elephant
~91%
Highest accuracy
Giraffe
~88%
High accuracy
Buffalo
~85%
High accuracy
Grevy's Zebra
~62%
Known limitation
Plains Zebra
~60%
Known limitation

Select a species above to see detailed notes.

From one week to minutes

The most immediate benefit is speed. What previously required up to a week of staff time can now be processed in a single session. A full month's camera trap data runs through the pipeline in minutes, dramatically increasing the frequency and consistency of corridor monitoring.

Speed

One month of footage processed in a single pipeline run, down from weeks of manual review.

📊

Structured Data

Species-level IN/OUT counts enable longitudinal analysis and seasonal movement tracking.

🔬

Scalable

Pipeline architecture accommodates new camera placements or additional species classes.

🎯

Validated

Comparative test against manual count: within +3 inbound / -10 outbound over 300+ images.

A secondary strand of the placement involved predator scat analysis in collaboration with Felix Kasyoki (Head of Predator Research). I developed a decision tree and improved reference sketches for hair strand microscopy — supporting identification of prey species consumed by lions and hyenas across the Lewa/Borana landscape.
← All Projects Next Project → PDSB Community Gap Analysis