Arc Sound Dashcam

Arc Sound marks when sounds start and end in dashcam and in-cabin audio, and what they are: crashes, horns, sirens, skids, glass, shouts and more, as a live timeline. This repository has the model and its inference code:

  • libarcsound: a native C library (C99 + libm, no other dependencies) with a streaming API. You push PCM in any chunk size and get events back.
  • arcsound_cli: a command-line tool for WAV files, ffmpeg pipes and live microphones.
  • python/arcsound: a small numpy reference implementation that the C library is tested against.

The model is small (1.9 M parameters, 7.6 MB in float32) and causal: it never looks ahead, so it labels audio live with 0.1-0.2 s latency. It is built for small boards such as the Raspberry Pi Zero 2 W.

Categories

group categories
incident crash_impact, glass_break, tire_skid, debris, incident (the whole crash sequence)
alerts horn, siren, alarm_beep, train
people and animals scream_shout, dog
vehicle door, click_mech, engine, vehicle_pass
scene traffic, thunder, water, wind_rain, music, hum

Each event has a start and end in seconds, a category, and a score: the peak presence probability inside the event. Sounds can overlap, so a horn during traffic noise is reported as two events.

Quickstart

hf download WhissleAI/arc-sound-dashcam --local-dir arc-sound-dashcam && cd arc-sound-dashcam
(cd model && sha256sum -c SHA256SUMS)     # model/arcsound.safetensors, model/arcsound_meta.json
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release && cmake --build build -j
ctest --test-dir build --output-on-failure

# a video or any audio file, through ffmpeg
ffmpeg -loglevel error -i drive.mp4 -f s16le -ac 1 -ar 16000 - | ./build/arcsound_cli -
# a 16 kHz mono 16-bit WAV file, one JSON object per event
./build/arcsound_cli --json clip.wav
# live from a microphone (Linux / Raspberry Pi): on/off changes as they happen, events as they finish
arecord -q -f S16_LE -r 16000 -c 1 -t raw | ./build/arcsound_cli --live -

Example output on the first 60 s of clip tv1_000 of the public test set WhissleAI/arc-sound-dashcam-test-v1 (start end category score; music and traffic rows left out):

    9.60    10.20  crash_impact  0.34
    9.60    11.80  wind_rain     0.23
    9.60    12.40  incident      0.66
    9.70    12.40  debris        0.32
   10.20    12.30  scream_shout  0.36
   12.80    13.20  horn          0.43
   13.00    13.30  alarm_beep    0.27
   14.90    15.20  scream_shout  0.25
   58.60    58.90  crash_impact  0.40

Reference labels in the same 60 s: crash_impact 9.5–9.7, incident 9.5–12.0, debris 9.6–12.0, scream_shout 14.1–15.0, click_mech 57.9–58.0.

Options:

  • -m DIR: the model directory (default model).
  • --threshold CAT=P: change a category's presence threshold (repeatable). Lower finds more, higher is stricter.
  • --probs F: write every frame's probabilities as float32 frames x 3C.

Python (numpy, plus ffmpeg on the PATH):

PYTHONPATH=python python -m arcsound drive.mp4 --json drive.events.json --srt drive.srt

The .srt file can be loaded as subtitles on top of the video to review the timeline.

C API

#include "arcsound.h"

char err[512];
arcsound_model *m = arcsound_load("model", err, sizeof err);   /* one model, many streams */
arcsound_stream *s = arcsound_stream_new(m);

while (read_pcm(buf, &n)) {                        /* 16 kHz mono; float [-1, 1] or int16 */
    arcsound_push_s16(s, buf, n);

    int act[ARCSOUND_MAX_CATS];                    /* what is sounding right now (0.1-0.2 s latency) */
    int na = arcsound_active(s, act, ARCSOUND_MAX_CATS);

    arcsound_event ev[64];                         /* finished events, with refined start / end */
    int k = arcsound_poll(s, ev, 64);
    for (int i = 0; i < k; i++)
        printf("%.2f-%.2f %s %.2f\n", ev[i].start, ev[i].end, arcsound_category_name(m, ev[i].category), ev[i].score);
}
arcsound_flush(s);                                  /* end of input: finish the last events, then poll again */
arcsound_stream_free(s);
arcsound_free(m);

See include/arcsound.h for the full API: thresholds, per-frame probabilities, reset.

Timing. The model makes a decision every 0.1 s from the audio so far. arcsound_active() follows presence with 0.1-0.2 s of delay. A finished event (arcsound_poll) is reported once later audio can no longer change it, about 1.5 s after it ends. That is when its start and end have been refined from the boundary outputs. Streaming results do not depend on chunk size: pushing one sample at a time or a whole file gives bit-identical output (tests/test_stream.c).

Threads. A loaded model is read-only and can be shared. Each stream must be used by one thread at a time.

Outputs and decoding

Every 0.1 s the model outputs three probabilities per category: presence, onset and offset. The event decoder turns them into events:

  • smooths presence over 3 frames;
  • applies per-category on / off thresholds (off = 0.6 x on; change them with --threshold);
  • merges gaps of 0.5 s or less and drops events shorter than 0.3 s (long sounds such as trains and water have their own gap and minimum length in model/arcsound_meta.json, decode.per_cat);
  • for impulsive sounds, moves the start and end to the peaks of the onset and offset outputs.

Stretches of digital silence (muted or cut audio) never produce events.

Results on the public test set

Evaluated on WhissleAI/arc-sound-dashcam-test-v1: 37 real dashcam recordings (9.1 h, 5.3 h reviewed), annotated by category with start and end times. The scores follow the dataset card's protocol: event F1 with a 1 s onset collar for event categories, 1 s segment F1 for continuous ones, mean over categories with at least 5 reference events, scored only inside the reviewed spans.

We ran openly available sound models through exactly the same scoring. Their AudioSet classes were mapped to the 21 categories (for example Vehicle horn, car horn, honking -> horn; AudioSet Strong's renamed classes such as Tire squeal, skidding and Glass shatter included), every system went through the same event decoder, and every system's per-category thresholds were chosen by two-fold cross-validation on the test clips (tune on one half, score the other, swap), as the dataset card asks. The audio language model gives no scores, so its answers are used as-is.

Model Params How it was run All 37 clips 31 clips (no crash-compilation channel) 11 clips (held-out channel) Clip tagging F1 Median onset error
Arc Sound Dashcam (this model) 1.9 M streaming, causal, on-device 0.358 0.301 0.375 0.625 0.1 s
ATST-Frame, PretrainedSED 86 M frame-level, AudioSet Strong, 10 s chunks 0.259 0.265 0.307 0.621 0.2 s
BEATs, PretrainedSED 91 M frame-level, AudioSet Strong, 10 s chunks 0.224 0.242 0.266 0.588 0.2 s
frame_mn10, PretrainedSED 3.8 M frame-level, AudioSet Strong, 10 s chunks 0.220 0.235 0.312 0.606 0.2 s
frame_mn06, PretrainedSED 1.6 M frame-level, AudioSet Strong, 10 s chunks 0.219 0.221 0.298 0.592 0.2 s
AST (AudioSet) 87 M clip tagger, 2 s window centred on each 0.1 s 0.218 0.229 0.310 0.576 0.8 s
PANNs CNN14 81 M frame-wise output (Cnn14_DecisionLevelMax) 0.214 0.209 0.303 0.564 0.4 s
EfficientAT mn04 1.0 M clip tagger, 2 s window centred on each 0.1 s 0.199 0.193 0.312 0.546 0.8 s
Qwen2.5-Omni-7B (audio language model) 7 B prompted with the 21 categories, one answer per 5 s window 0.130 0.147 0.175 0.551 5 s windows
  • Arc Sound Dashcam scores 0.358, 0.10 above the strongest other model (ATST-Frame, 0.259), with a fraction of the parameters and while running causally on one CPU core.
  • AudioSet has no class for a whole crash sequence, so the other models score 0 on incident. Leaving incident out, Arc Sound Dashcam scores 0.351 against 0.272 for the best other model.
  • Clip tagging F1: does the category occur anywhere in the reviewed audio of a clip. Most models are close here; the difference is in finding road events at the moment they happen.
  • Median onset error: for matched events, how far the detected start is from the reference start.
  • Two independent human reviews of the same audio agree at roughly 0.55 to 0.8 F1 per category, which bounds the score any system can be expected to reach on this set.

Per category on all 37 clips (F1; categories with at least 5 reference events):

Category Reference events Arc Sound Dashcam ATST-Frame BEATs
crash_impact 192 0.56 0.23 0.18
glass_break 14 0.22 0.26 0.31
tire_skid 18 0.43 0.42 0.39
debris 43 0.36 0.06 0.00
horn 213 0.59 0.56 0.50
siren 41 0.30 0.35 0.41
alarm_beep 133 0.44 0.58 0.47
train 60 0.28 0.24 0.18
scream_shout 155 0.34 0.28 0.29
dog 13 0.18 0.29 0.17
door 40 0.17 0.08 0.07
click_mech 168 0.25 0.04 0.05
engine 253 0.23 0.11 0.10
vehicle_pass 59 0.15 0.04 0.01
traffic 3790 0.64 0.23 0.17
water 45 0.13 0.10 0.05
wind_rain 2014 0.55 0.55 0.40
music 3316 0.69 0.64 0.60
hum 349 0.16 0.12 0.14
incident 143 0.48 0.00 0.00

Performance

  • x86-64: one core runs about 40x faster than real time (plain C, -O3, no SIMD).
  • Raspberry Pi Zero:
    • Per 0.1 s frame the model does about 3 M multiply-adds, plus a 512-point FFT every 10 ms.
    • A Pi Zero 2 W should run it in real time with room to spare. The original Pi Zero (ARM11, no SIMD) is probably too slow for this model.
    • Neither board has been measured yet; measurements will be added here.
  • Memory: the weights take 7.6 MB, and each stream keeps about 0.5 MB plus 2.5 KB per second of audio (the per-frame probabilities; about 9 MB per hour).

Tests

  • ctest: streaming invariance (tests/test_stream.c, synthetic audio). The same audio pushed in chunks of 1 to 16000 samples must give bit-identical probabilities and events.
  • python tests/parity.py AUDIO.wav: the C library against the Python reference. Requires numpy and soundfile. On a 10.9-minute dashcam recording:
    • all 6,535 frames, maximum probability difference 2e-4;
    • all 111 events identical.

Licence

Model weights and code Β© Whissle Inc.: CC BY-NC 4.0 plus the Whissle terms in LICENSE. Non-commercial use only. For commercial licences contact Whissle Inc. (ksingla@whissle.ai). Third-party components are listed in NOTICE.

Limitations

  • Built for road and in-cabin audio; outside that setting (indoor, music venues, nature) expect many more errors.
  • Some categories (glass_break, dog, tire_skid, thunder) have few test events, so their scores are noisy.
  • Dashcam audio is often heavily compressed and wind-affected; quiet distant events can be missed.
  • It is a sound detector, not a judge of what happened: an incident event is a cue for a person to review the footage, not a crash report.
Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train WhissleAI/arc-sound-dashcam