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 ?
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.
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.
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!).
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!.
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.
This these have been working well for me. It isn’t AI but it was created with AIs help. Using a max4466 mic and a nodemcu type 8266 with esphome. It picks up short bursts of loud sounds and that’s usually my dog barking. Greta btw. Every level could be changed to suit and or fix for your conditions. So many his/hers FBai/Chatgpt 'cause it was testing code. Much of it may not be needed.
I had the same need and never found a good option, so I built one: a Home Assistant
add-on that detects dog barks from a USB microphone plugged into the HA
machine — no camera required.
Frigate and yamcam both do YAMNet audio classification well, but both need a
camera RTSP stream. I wanted a mic in a room with no camera, so this reads a
locally attached USB microphone instead, you can buy a cheap USB mic stick for your raspberry, but it works better with a nice mic, I’m using it with a Blue Yeti Nano and it works really well.
What it does
Classifies audio locally with YAMNet (TensorFlow Lite) — nothing leaves your network
Creates a binary_sensor automatically via MQTT discovery, so no manual YAML
Picks up MQTT credentials from the Mosquitto add-on via the Supervisor
Optionally saves clips to /media, playable in the Media panel, with the
confidence score in the filename so you can tune against real examples
Sliding-window voting + cooldown to reject one-off transients
Install: add the repo URL under Settings → Add-ons → ⋮ → Repositories.
Runs on aarch64 and amd64. On a Pi 4 it uses 1.3% CPU and 88 MB RAM.
The thing I wish I’d known first: your microphone matters far more than any
setting.
I spent hours tuning thresholds before measuring properly. Same room, same Pi,
same settings — a cheap USB electret recorded nothing at all during barks I
could clearly hear, while a USB condenser picked up dogs several hundred metres
away and scored them 0.67.
Cheap capsules have a self-noise floor around 35–40 dB SPL. A distant bark isn’t
quiet, it’s below that floor — genuinely absent from the recording. Gain,
thresholds and normalisation all scale signal and noise together, so none of
them recover it. If you’re chasing distant dogs: get the mic outdoors or to an
open window (worth 20–30 dB, more than every software option combined), and use
a decent capsule.
Realistic range: dogs in your house or a neighbour’s yard are reliable. A
kilometre away is best-effort on a quiet night.
Happy to take feedback — it’s MIT licensed and the detection parameters are all
exposed in the add-on config.