Dog Barking Detection

Hi all!

Im trying to find a way to detect if my dogs are barking outside. I do have a camera trained on the spot they often bark in, but they also like to hang out in that same spot and sun themselves during the day, so camera detection isnt quite enough.

Other than getting some kind of microphone and “training” it to detect a specific noise, are there any other options ?

No idea, but keen to learn.

Not sure if you have Alexa but you can do this with an alexa routine:

This first part isn’t answering the question directly, but reading this made me think about another entertaining but related post. In this case, a camera with line crossing detection is used, and it’s assumed that when the dogs are in a particular location that they are barking.

Apple’s Siri also has sound recognition and support for detecting barking dogs. Not sure if that will work for you.

While I work in the machine learning field, I haven’t attempted embedded ML models, but have a look at TensorFlow Lite and TinyML that can run on an ESP32. I suspect you might even find pre-trained models. Regardless, there will be some DIY involved.

I’m in the process of doing something similar. My setup is a Raspberry Pi 4 with a 4-channel microphone connected to it. I collected some data, around 30 mins worth of dog bark and trained a simple feed-forward neural network to detect dog barks. The reason for using a 4-channel microphone was to distinguish direction of arrival as well. The problem I’m trying to solve is that we have a neighbor’s dog and when that dog barks, my dog responds back, then they keep barking at each other. To break that cycle, a few dog trainers told us to treat our dog when he doesn’t respond and that works quite well, however when we’re not there, there is no one to reward him and he gets into barking mode. I’m trying to automate this whole thing, detect neighbor’s dog bark using my 4-channel mic, then dispense treats. So far I’ve found this feeder that works with HA: Smart Pet Feeder C1. Once I’m a bit more happy with my setup, I’ll share more details here.

2 Likes

I know you mentioned you’d share this when you were ready but if you have any information that you’re willing to share, I would appreciate it.

I am trying to find a solution to detect and be notified of when my dog is barking, primarily when he is in his kennel. I have a camera set up in his kennel, so the audio stream from that could be used. Just not sure how best to handle the identification of a bark versus other noises. (I have tried solutions using the detected amplitude of the audio, and being notified if over a certain threshold, but would get false notifications.)

I’d certainly be open to setting up a Raspberry Pi to handle the detection if needed.

I’m currently using the Alexa routine method mentioned in a previous reply to this thread, but am hoping for a local solution. Wasn’t sure if what you’re working on could point me in the right direction.

here is my first version: GitHub - mdoulaty/woofalytics: AI Powered Woof Analytics!
it’s not exactly integrated with homeassistant (yet), but should be a good starting point and the integration should be very easy.

1 Like

While overkill if you just need barking detection, Frigate can now do that if you happen to already have cameras setup.

My use case was slightly different, I needed only the neighbour’s dog’s bark to be detected, and not my own dog’s bark (or any other dogs in the neighbourhood!).

If you use Frigate this is a feature coming in the 0.13 release see the beta release notes for information:

Audio Detectors | Frigate (deploy-preview-6262–frigate-docs.netlify.app)

This is a very interesting discussion, and have the same requirement for detecting my neighbour’s dog’s.
Should it be possible to run Frigate without a camera? So just the audio-bit? Or is this dependent on the camera integration that you know off? (@flyize, @pyrodex)
Any input / ideas on this topic would be warm welcomed!.

Thanks,

I mean if you can create an audio source and present it to Frigate via RTSP I would ASSUME this would work.Its an interesting question to ask over in the Frigate discussions on GH.

1 Like

I think you need a sound camera which location sounds location,then get which dog is barking