Inside a greenhouse at West Virginia University, a robot is rolling down aisles of blackberry plants learning to act like a bee. Computer vision algorithms are being developed to help the robot locate flowers, and its robotic arm, topped with a set of soft brush tips–designed to act like a bee’s hairs–will gently reach out to each flower and pollinate it. At the moment, the arm is practicing its technique on QR codes placed inside the blackberry bushes.

“From a robotics point of view, we’re always trying to find solutions to the urgent problems in the world,” says Yu Gu, an engineering professor at the university who is working on the design of the robot, called the BrambleBee. Around three-quarters of food plants rely at least in part on pollinators, and pollinators are struggling.

Colony collapse disorder, the mass deaths of honeybees from a combination of factors including diseases, pesticides, stress, and climate change, is making pollination more expensive as beekeepers have to continually replace bees. Forty percent of wild insect pollinators, including bumblebees and species like the Hawaiian yellow-faced bee, are at risk of extinction. Robotic pollinators, at least in theory, could help provide some of the same services.

Gu, who has designed more than a dozen UAVs and ground robots, became interested in a pollinating robot in part by chance; he lives down the street from an entomologist who keeps backyard bees. As Gu worked on a NASA challenge to design a robot that could autonomously collect samples in space–eventually winning the challenge–he also watched his neighbor’s bees pollinate his own garden, and thought about the challenges that bees faced. “We built up a lot of robotics capabilities, and that triggered the thinking that we probably could do something about the decline of bees’ populations,” he says.

He partnered with the entomologist to develop a proof of concept of a pollinating robot. Working with a horticulturalist, they decided to work on blackberries and raspberries as a first crop. The plants are technically self-pollinating, but the fruit doesn’t grow well without bees. They can grow in a greenhouse, and the team wanted to be able to test the idea in a controlled environment. The flowers are also positioned in a way that robots can easily reach.

The robot works by first creating a 3D map of the greenhouse, detecting flowers and devising an efficient route to take as it pollinates. Computer vision algorithms estimate the position, size, and condition of flowers, and guide a robotic arm to gently brush each flower’s pollen. The team is still working on the technology to help the robot identify flowers–detection is difficult because of how flowers are clustered together and often overlap (as opposed to human faces, which algorithms can easily identify). It’s also difficult to estimate the angle of the flower so that the robot can approach correctly. But the prototype can now “pollinate” QR codes on the plants.

The researchers are not alone in trying to create robotic pollinators. Some others are working on tiny drones; in March, Walmart filed a patent for autonomous pollination drones. Gu believes that a rover is more feasible with current technology. “It’s probably more intuitive to think about a bee-like robot to fly around, but that needs a lot of work just because trying to miniaturize a drone to be small is tough,” he says. It’s hard to fit sensors, computers, and batteries on an insect-sized drone.