Analysis

On an Arduino wildlife monitor, extracting the audio features took 289 ms

The prototype took about 303 ms to classify a completed audio window. Running the neural network itself accounted for about 2 ms.
Bioacoustics researcher Erin Netoskie straps an autonomous sound recorder to a tree in Sierra National Forest

An animal sound monitor built on an Arduino Nano 33 BLE Sense Rev2 spent almost all its processing time preparing audio for its classifier. In playback tests, researchers measured around 303 ms from the end of a captured window to a result. Extracting the audio features took about 289 ms on average, while invoking the quantised neural network in TensorFlow Lite Micro took around 2 ms.

The board records through its onboard PDM microphone at 16 kHz and groups the converted samples into 200 ms windows. That gives it 3,200 samples to consider before it produces a classification. It first checks the signal energy, leaving the heavier feature extraction and classifier idle when the audio is below the trigger threshold. When a window does qualify, the Nordic nRF52840 divides it into overlapping frames and calculates Mel-frequency cepstral coefficients, the compact representation the model was trained to recognise.

Training took place on a computer, so the researchers matched its feature extraction to the C++ code running on the microcontroller rather than relying on the defaults of a desktop audio library. A 200 ms window is divided into 256-sample frames with 50% overlap, and the two implementations use the same window, FFT length and filter settings. The firmware also applies the normalisation values calculated during training. To check the agreement, the team fed both versions the same PCM sample and compared the feature vectors before classification.

The resulting INT8 classifier occupied about 26.9 KiB. The deployment firmware’s global variables used roughly 148 KiB of SRAM, which illustrates why the model file alone is a poor measure of the memory needed to buffer the audio and run the rest of the pipeline.

The evaluation separated source recordings across training and test sets so adjacent segments from the same recording did not end up on both sides. In the single-run baseline, the classifier achieved 98.28% accuracy on the held-out set, which contained six target animal classes and a combined background class. The timing came from acoustic playback on the board; the classification score came from that dataset, not a field trial.

The signal energy threshold also changes how often the heavier processing runs. During background playback, raising it from 200 to 300 reduced the share of windows that triggered from 5.90% to 1.74%. Those are thresholds in digital audio counts, not calibrated sound levels. The researchers used 300 for the prototype after comparing triggering under quiet monitoring, animal playback and background playback.

At the development board’s 5 V input, measured power ranged from 0.783 to 0.825 W. The team used those measurements to estimate 7.6–8.0 hours from a 3.7 V, 2 Ah battery at 85% conversion efficiency. Background playback gave the shortest estimate because it activated the processing path more often than quiet monitoring. The figures describe the development board rather than an optimised battery node.

Sources

Lead image: Erin Netoskie installs a sound recorder for a separate spotted owl survey in Sierra National Forest. Photo: Jamie Hinrichs / USDA Forest Service. Original photograph · Public domain

Continue reading