RangerEye

Year

2026

Stack

Python PyTorch RF-DETR OpenCV Electron

Partner

SPOTS × Team Epoch

Abstract

To round off my year at Team Epoch, we flew to South Africa to work with SPOTS, an organisation that uses technology to fight poaching. Most poaching happens at night, when rangers are fighting sleep. In three months, the last two weeks of which on-site, we built RangerEye: a system that spots people in a drone's live thermal feed, from 100 meters up, at night. Starting from raw, unlabelled footage, we built the whole product ourselves, from a labelling tool to the detection model to the interface the pilot uses. I was the project lead: involved in most aspects, but focusing on building the detection model, using RF-DETR.

1 Problem

The idea started with a conversation at a bar, about a park in South Africa that offered internships to engineers. We took a shot and contacted them. It turned out to be SPOTS, Strategic Protection of Threatened Species, and its organisation WILD, which works to protect a game reserve in South Africa.

The sun rising behind the silhouette of a bare tree, seen from inside a game-drive vehicle.
Figure 1: Sunrise over the reserve: working days start early in SA.

Rangers already use drones to support their patrols: one pilot can watch a large area and radio the ground team when something looks off. But training pilots is intensive, there are few of them, and the park keeps growing. They knew they wanted to automate the entire process, so we sat around the table with both teams and came up with the next step.

Enter the AirRanger: a fixed-wing drone that flies patrol routes autonomously at a higher altitude and flags anything suspicious. For that to work, the drone needs to spot people by itself. Our challenge: make that possible.

That is harder than it sounds. Detecting people in normal colour images is a solved problem, but at night the drone relies on its thermal camera, and (to our knowledge) there were no public models for spotting people in thermal drone footage. From 100 meters up, a person is just a few pixels: a small warm blob that looks a lot like an animal, or a warm rock. And for the first time, we had to deal with a real-life dataset: raw, unlabelled and messy.

Summing up, we had to deliver an entire computer vision pipeline, a first-of-its-kind dataset and finally a ranger companion app, while having nothing to go off. This was definitely the most ambitious project we had taken on so far.

2 Approach

The system runs on a laptop on the ground. The drone streams its thermal feed to the pilot's controller, which passes it on to the laptop. There, a detection model and a tracker draw boxes around anything that looks like a person, on top of the live feed the pilot is watching.

Four team members gathered around a laptop on the back of a vehicle in the bush, watching the drone feed.
Figure 2: The first test of the full system in the field.

Labelling. Before training anything, every person, animal, vehicle and dog in the footage needed a box around it. We tried existing tools (Label Studio, CVAT, Roboflow), but ended up building our own: SPOTStudio. Its key feature is auto-tracking: you label a few frames, and the app fills in the boxes in between by following the actual motion in the video with optical flow. That cut labelling time noticeably, which mattered, because new footage kept coming in throughout the project.

The SPOTStudio labelling app: a list of thermal recordings on the left and a grey thermal frame on the right with two small boxes labelled poacher, and an Auto-track button.
Figure 3: Labelling in SPOTStudio. The two boxes are people, just a few pixels each. Auto-track fills in the boxes for the frames in between.

The detection model. We started with YOLO as a baseline and also tried a two-stage approach, but RF-DETR, a transformer-based detector, worked best. It looks at the whole image at once instead of scanning it piece by piece, and it is fast enough for a live feed.

Models like RF-DETR are pre-trained on colour photos, which have three channels (red, green and blue), while thermal footage has only one. Instead of copying the same frame three times, I used those channels to add motion. The first channel is the current frame; the other two are the differences with the frames 0.1 and 0.2 seconds earlier. Anything that stands still, like trees and rocks, cancels out in those difference channels, while a walking person lights up. From high up, that movement is often the clearest sign that someone is there at all.

There is a catch: the drone itself moves, so the whole scene shifts between frames, not just the people. So before taking the differences, the frames are aligned to each other using optical flow (KLT), which estimates how the background moved and cancels it out.

I also researched different ways to fine-tune the model on our data: training the whole network, freezing the pre-trained encoder and only training the layers on top, and DoRA, which keeps the pre-trained weights frozen and learns small adapter updates on top of them. One useful finding for the future: training on only every tenth frame stack gave virtually the same accuracy, which makes retraining on new footage much faster.

Tracking. The detector looks at every frame separately, which on its own gives flickering boxes. A tracker (ByteTrack, with a Kalman filter that predicts where each person moves next) links those boxes over time, so the overlay stays steady and a person isn't lost when the detector briefly misses them.

The interface. RangerEye is what the pilot sees: the live feed with the detections drawn on top, and switches for what to detect. It is deliberately kept separate from the training code, so the pilots and the people retraining the model never get in each other's way. SPOTS can also retrain the model on new footage from within SPOTStudio, without writing any code. After we left, they had to be able to run, fix and improve everything on their own.

The RangerEye live interface: a dark sidebar with toggles for humans, dogs, animals and vehicles, next to a thermal aerial view of bushland with two boxes labelled human.
Figure 4: The RangerEye live feed, with two people detected in the bush.
The Train tab of SPOTStudio: a list of labelled videos to select and a Train button.
Figure 5: Retraining without code: select labelled videos, press Train.

3 Results

We tested the system in the field in the morning, the afternoon and at night. The result: our model made the drones capable of spotting people autonomously, from 100 meters up, at night. Arina, a trained drone pilot, reviewed the interface, and on our last day we presented and handed everything over at SPOTS HQ.

The detailed results are not on this page on purpose: the less poachers know about what the system can and can't see, the better.

The team at night on a vehicle under a bright lamp, one person looking at a tablet while another points at the sky.
Figure 6: A night test. Testing is still ongoing.
A drone hovering against a blue sky just above the raised hand of a team member who launched it.
Figure 7: Launching the drone by hand.

4 Reflections

This was the first time we worked with real-world data, and it showed. There was no clean benchmark to optimise: the data had to be collected, labelled, cleaned and labelled again. By embracing that process, we learned to build a fully deployable ML system from the ground up, and to take ownership of the entire product, not just the model.

One thing we stressed at the handover: how do we make sure the performance of the model doesn't drift over time? Once we left, no one would be there to do technical maintenance of any of the deliverables, so we had to take into account the limitations of our client's team. That's why we focused on leaving behind a sustainable way to collect new data and train models with the updated datasets.

All in all this was a project which pushed our limits. Building for something halfway across the world in a hostile environment was crazy. Seeing the ranger activities made me realise this was the first time I contributed to saving animal (and human) lives through the use of AI. Testing is still being done, but I hope this will not be the end of this story. Huge thanks to the Epoch VI team, and to Robi Beninca, Arina Hattingh and Johan Benade at SPOTS for the amazing experience (and all of the crazy stories). Truly once in a lifetime.