--- license: mit tags: - audio-classification - yamnet - emergency-detection - wearable - fine-tuned library_name: tensorflow --- # Titung/urban-surveillance-mode-classifier-finetuned-v_final-v2 YAMNet fine-tuned end-to-end (not just a frozen-embedding head), for a personal safety wearable. Trained on a merge of two datasets: - `Titung/urban-surveillance-audio-raw` (primary source; includes a fix for a `crash_clips` empty-audio bug -- rebuilt from `Titung/car-crash-audio-clips`) - `Titung/emergency-surveillance-sounds` (added `Fire`, `Car Crash`, `Screams`, `Siren`, and `Background` examples; introduced `Fire` as a new 9th class not present in the original taxonomy) Thin classes (`Tire Skidding`, `Vehicle Mechanical Sound`) were additionally oversampled during training. Classes: ['Background', 'Car Crash', 'Glass Breaking', 'Gunshots', 'Screams', 'Siren', 'Tire Skidding', 'Vehicle Mechanical Sound', 'Fire'] ## ⚠️ Known issues in this checkpoint (not yet resolved) - **`Fire` had zero positive examples in the validation split** (a group-aware split bug), so its alert threshold in `thresholds.json`/`alert_policy.json` is an uncalibrated default (0.5), not a real calibration. Treat `Fire` alerting as unreliable until retrained. - **`Car Crash` and `Fire` substantially confuse each other on the test set** -- ~26% of true `Car Crash` examples are misclassified as `Fire`, dragging `Fire` test precision to ~0.07 despite good recall. Likely acoustic similarity + `Fire`'s high class weight. - **`Tire Skidding` shows a large val/test precision gap** (val precision 0.86 vs. test precision 0.19 at the same recall) -- consistent with overfitting from 4x oversampling on only ~136 source clips. - **`Vehicle Mechanical Sound` has only 4 test examples** -- its reported metrics are not statistically meaningful at this sample size. This is the fine-tuned counterpart to the frozen-head baseline. Compare `metrics.json` against that run before deciding which to ship -- fine-tuning only wins if it improves the thin classes without collapsing generalization (check the train/val macro-F1 gap in Cell 11). ## Files - `saved_model/yamnet_finetuned.weights.h5` + `saved_model/head.weights.h5` -- weights-only export (SavedModel export hit a known TF export bug -- see metrics.json `export_format` field; reload pattern is in the training notebook) - `class_names.json` -- index-to-class-name mapping (model output order, 9 classes) - `thresholds.json` -- per-class calibrated decision thresholds (recalibrated for this model; see known issues re: Fire) - `alert_policy.json` -- per-mode (driving / trek / night_walk / standby) class thresholds - `metrics.json` -- test macro-F1, per-class test F1, and the LRs/epochs used ## Test performance Macro-F1: 0.6614 (see known issues above -- several classes have specific, understood problems)