Real-time bee monitor

By David Crookes. Posted

Scientists seeking to better understand the ecology of bees know that monitoring them in the wild is no easy task. Harmonic radar – the best way of tracking bees – is expensive and complicated, which is why researchers are currently abuzz over a new method that puts a Raspberry Pi computer at its heart.

Led by computer scientist Michael Smith, a team of researchers from the University of Sheffield and The Bumblebee Conservation Trust have figured a way to make the striped insects easier to spot. They're dressing bees in hi-vis retroreflective vests and taking photographs of the environment, before subjecting them to a machine learning model that operates in real-time.

“I was reading books by Dave Goulson, who described the problem of finding the nests of bees, and it got me thinking of ways to spot them from a distance without needing an electronic tag,” Michael tells us. “When I was cycling home one evening, I noticed how retroreflectors are very noticeable when lit by the blinking bike light.” It was a eureka moment.

Bee-hold Raspberry Pi

Michael devised a method in which two photographs would be taken of an environment – one using a camera flash and the other without. He experimented by connecting a Raspberry Pi 3 to an industrial global electronic-shutter camera, but soon switched up to a Raspberry Pi 4. “The better CPU meant we could process images much faster and the extra memory improves the image analysis as more images can be processed at once,” he says.

Study co-author Mike Livingstone is catching bees from the researchers’ nest in order to tag them

The method depends on being able to take a flash photograph, so the camera needs to be able to expose the entire sensor at once, not just scan lines. “The very short exposure you can get with the electronic shutter (down to one microsecond) means I can match the exposure to the length of the flash, which is a few microseconds,” Michael continues. “It means almost all of the illumination in the photo is from the flash, even on a bright sunny day, and so it's easier to detect the retroreflector.”

Hive of activity

The machine learning process subtracts one photo from the other, leaving an image containing bright spots if the retroreflector-wearing bees happened to be in the frame.

Since the tracker works best when it’s looking down and is away from clutter, the scientists have experimented with ways of getting the system in the air, trying a hexacopter UAV, a 10 metre mast, and a tethered balloon

“Machine learning helps to remove false-positive spots caused by other objects such as moving trees and litter,” says Michael, who collected the machine learning data with two of his students – Isaac Hill and Chunyu Deng – by walking around in front of the tracking system with a reflector on the end of a stick.

“To build the system, we manually labelled where our reflector was in the photos afterwards. These labels, combined with false positive dots in the same images, were used to train the classifier, and we used Raspberry Pi OS, Python 3.x, standard libraries, and the Aravis library to interface with the camera and process the results.”

 The retroreflective tags placed on the bees are made of the same fabric as the high-visibility vests worn by cyclists

So far, the team have been able to detect bees from up to 40 metres away and this has thrown up some surprising results. On one occasion they found buff-tailed bumblebees up a pine tree some 33 metres distance in a location the researchers wouldn't have usually looked.

“We've used the trackers in gardens, fields, and at various places on the university campus, but we're in touch with other researchers who will be using them for looking at the initial flight of bees as they leave nests or for monitoring bees foraging inside glass-houses. It also makes sense to think about tracking and detecting other insects. There are a lot of open research questions in behavioural entomology.”

From The MagPi store

Subscribe

Subscribe to the newsletter

Get every issue delivered directly to your inbox and keep up to date with the latest news, offers, events, and more.