Following the theft of a package from his porch earlier in the year, Ryder decided to take action. “It had never happened to me before and I was a little frustrated,” he recalls. “I’d been doing some image classification work at the time, and figured this would be a great opportunity to build something to deter people from stealing packages from my porch.”
Armed with a Raspberry Pi 4, a security camera, and various other ingredients, he set about making something that certainly caused a stir in the neighbourhood, as his must-watch YouTube video demonstrates. “I built the project more for entertainment value than actual use (since I’ve only ever had one package stolen), but I consider it a success either way,” he tells us.
So, how does the alarm system work? Using a security camera pointed at Ryder’s door, images from the camera are pulled by his Raspberry Pi and processed by a custom machine learning model to detect if there is or isn’t a package.
“If a package has been taken unexpectedly, Raspberry Pi sends signals to a relay (via its GPIO pins) to activate a variety of alarms to entice the ‘thief’ to drop the package,” Ryder explains. Those surprises for thieves include a sprinkler, a loud truck horn, and a flour shower.
“This is definitely a great project if you’re looking to get your feet wet into machine learning – though I don’t recommend you implement the sprinkler, flour, or air horn components,” he says. “All the participants in my video were friends and neighbours of mine, and implementing the exact same setup for the public will likely get you into some sort of trouble,” he cautions. However, he does suggest that you can modify the project to send you an email when a package arrives, or has been taken unexpectedly, which may be a more prudent route to take!
Averting a cat-astrophe
Computer vision is central to Ryder’s project, and he used Google Cloud AutoML to train the machine learning model. “I wanted something to include in my video that was easiest for those getting started with machine learning to use,” he reveals. “Training a model yourself can be quite intimidating.”
It wasn’t plain sailing to get this system working as he wanted. Ryder originally had all alarms and sprinklers go off at the same time, but decided to move them to separate threads with separate timings in order to best soak his very obliging friends and neighbours. “The model [is] great at detecting whether there is or is not a package,” he says “but it also sometimes recognises my cats as packages!” He also sensibly trained the system to disarm when he arrived to pick up his parcels.
Many co-operative friends and neighbours have embraced his undertaking, “though I did buy my neighbours a few boxes of chocolate afterwards to say sorry for the noise”, Ryder admits. For the time being, he has dismantled this project, “since I don’t really have the need for it, but I’m brainstorming some version two ideas – one of which involves a net.” Any future front-step felons may be in for a shock!