Letting AI Do the Dirty Work - Hackster.io

2022-09-02 23:11:59 By : Mr. James Zhang

Please ensure that JavaScript is enabled in your browser to view this page.

In the modern, connected world where we find ourselves, sensors of all sorts are constantly collecting data and sending it around the world for analysis to help us improve many aspects of our lives, from business to health. This sounds great in theory, but is it ever possible to have too much information? In 2017 The Economist famously made the assertion that data had superseded oil as the world’s most valuable resource. So more is always better, right?

I will let the reader decide the answer to that question, but before doing so, consider software engineer Estefannie’s latest creation. She built a device that is something like a baby monitor, but for a cat. Oh, and instead of giving you peace of mind that your child is safe and healthy, it lets you spy on your cat in the litter box. And since everyone wants to know, it also tells you exactly what your cat is doing while in the litter box.

This is not what most people would consider Must See TV, but Estefannie did have a good reason for building the device. One of her cats has a bad habit of eating plastics, which can cause intestinal blockages and serious illness. After consulting a veterinarian about the problem, she found that the procedures required to determine if there was a blockage were very expensive. By building this monitor, she could be sure that her furry friend was using the litter box frequently enough, and if not, it would be a sign that veterinary attention was urgently needed.

Jokes about the purpose of the monitor aside, it was developed using some very cool technologies and techniques that are well worth diving into. While Estefannie wanted the monitor to have a view of the litter box (you know, because reasons), she did not actually want to see what was happening. So, she used a thermal camera to instead have a low-resolution, blocky, roughly cat-shaped blob be visible. But she also wanted to know which of her two cats, Teddy Bear or Luna, was in the litter box so that she would know how things were going with the plastic-eating kitty. For that, richer imaging information would be needed. She installed a Raspberry Pi NoIR Camera Module V2 for this purpose to the Raspberry Pi computer that served as the main processing unit for the build. The NoIR cameras do not have infrared filters, which means they can be used to capture images in dark places, like where litter boxes are often found. Estefannie installed some infrared LEDs to make sure the images were well illuminated, without bothering the cats.

After installing the device above the litter box and collecting lots of images, they were used to train a machine learning object detection algorithm to distinguish between the two cats. After struggling with building the models on her own for a few weeks only to end up with poor results, Estefannie eventually settled on using an online service to help with the task. This made things much simpler, and produced a much better functioning model that could be deployed to the Raspberry Pi.

Naturally, no one would want to be without the vital information provided by this monitor for even a second, so Estefannie built a web application with a Node.js server to make it accessible from mobile devices. Through the slick user interface, one can see which cat is currently in the litter box, a live feed from the thermal camera, the cat’s temperature (because the thermal camera can provide this information, so why not), and a timer so you know how long the cat spent doing its business, which is used to infer exactly what that business was.

Using a few inexpensive pieces of hardware, Estefannie was able to avoid a huge bill from the veterinarian. And she hopes that she was also able to win the love of her often temperamental cat. These are some big wins, but should the AI singularity ever become a reality, Estefannie would do well to never mention this project again.