Acoustic Anomaly Detection: The Home’s Ear That Never Sleeps
CCTV cameras detect intrusion when a person is visible, but glass breaking happens before anyone appears in frame, and screaming occurs in camera blind spots. Acoustic detection closes this gap with continuous listening that processes all audio locally and privately.
YAMNet: Google Audio Classification
YAMNet (Yet Another Mobile Network) was trained on 2 million AudioSet videos across 521 audio classes, including glass breaking, screaming, smoke alarms, gunshots, and sirens. The TFLite model runs on Raspberry Pi 5 consuming ~180MB RAM and ~15% CPU — practical for always-on deployment.
Hardware
ReSpeaker 4-Mic Array (1,200 THB): four-microphone array with Direction of Arrival estimation, attaches directly to Raspberry Pi header. Alternatively, a USB omnidirectional mic (300–600 THB) covers single-room monitoring. Place in living room ceiling center, at the main entrance, and in the elderly bedroom.
Processing Pipeline
The Python pipeline streams 16kHz mono audio in 975ms blocks (15,600 samples). Each block runs through the YAMNet TFLite interpreter. Target classes have individual confidence thresholds: glass breaking (0.7), screaming (0.65), smoke alarm (0.8), gunshot (0.85). Detection events are published to MQTT for Home Assistant processing.
False Positive Reduction
Confirmation window: the event must occur twice within 3 seconds. Context suppression: when TV is active (via Home Assistant media player state), thresholds for TV-like sounds increase. Nighttime mode (22:00–07:00) reduces confirmation requirement to one occurrence. Direction estimation from the 4-mic array prioritizes sounds from exterior walls.
Privacy by Design
The system processes the real-time audio stream without recording any audio files to disk. Only event label, timestamp, and confidence score are logged — eliminating privacy risk from continuous audio recording.
Total Cost
Raspberry Pi 5 4GB (2,200 THB) + ReSpeaker 4-Mic Array (1,200 THB) + power and enclosure (400 THB) = 3,800 THB for a complete acoustic security layer covering the entire home.
