Meet my cat Indiana Jones (Indy)


Indy

The name doesn't suit him at all, he's actually very lazy and scaredy, chubby, and he does not like heights at all.

We started to suspect that he might be sneaking around and peeing on the front door mat because we sometimes could feel cat pee odour and suspicious stains.

So I thought it would be a nice home lab project to set up a monitoring system to see what is actually going on. I had an old webcam lying around, and a raspberry pi.

With a bit of Python and TensorFlow I whipped up a script that would constantly monitor the hallway for Indy's presence and send me an email if he was detected on the door mat.

The system would power down during the night because it's useless to monitor in the dark anyway, and Indy would be locked up in the living room during that time, and would restart in the morning using a Philips Hue smart plug.

It was rather easy to do, I had a couple of hundred pictures with him taken in different positions, especially top down and trained a model with those. I could have used one of the pre-trained models to detect a generic "cat" and it would have probably worked better, but I also wanted to go through the whole process myself.

The biggest hurdle was actually getting Tensorflow to install on the armv7 raspberry pi, did not expect it to be so difficult. And the performance was not great, somewhere around 1 frame per second, and the detection rate was about 50-70% accurate, but it was good enough. Sometimes it would send me notifications with false positives, like a foot, or my own hair, but I would keep all the screenshots it took in a separate folder and re-train the model every week with new material.

How did it go?

I used to get emails with him just walking around and chilling there for a bit, it was actually quite fun, to implement and to run. But did I catch him in the act in the end? Well, no, it turned out he was a good boy and he wasn't doing it. Most likely culprit was another cat coming around and peeing on the door from the outside just to spite him I think.

I since dismantled the setup because it was a bit inconvenient to keep, especially since I had to install a fan on the CPU of the raspberry pi for this, and it would be slightly noisy.

Webcam setup
Webcam screenshot

I also didn't upload the script anywhere like GitHub because I think it's nothing special, rather basic get-the-job-done kind of script.

These days I work a lot more with ML for my daily work anyway, but it was fun to do.