Instructions to use CaptainRapid/acoustic-alert-5class with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Keras
How to use CaptainRapid/acoustic-alert-5class with Keras:
# !pip install -U keras tensorflow huggingface_hub # Keras needs TensorFlow installed to read "hf://" paths, so the tensorflow backend is selected here; # "jax" and "torch" also work for computation once TensorFlow is installed. import os os.environ["KERAS_BACKEND"] = "tensorflow" import keras model = keras.saving.load_model("hf://CaptainRapid/acoustic-alert-5class") - Notebooks
- Google Colab
- Kaggle
Upload 5-class acoustic alert baseline
Browse files- .gitattributes +3 -0
- README.md +107 -0
- best_model.keras +3 -0
- classification_report.txt +11 -0
- confidence_threshold_sweep.json +444 -0
- confusion_matrix.png +3 -0
- final_model.keras +3 -0
- label_map.json +36 -0
- metrics.json +91 -0
- normalization.json +17 -0
- training_summary.json +20 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,6 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
best_model.keras filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
confusion_matrix.png filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
final_model.keras filter=lfs diff=lfs merge=lfs -text
|
README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
library_name: keras
|
| 4 |
+
tags:
|
| 5 |
+
- audio-classification
|
| 6 |
+
- tensorflow
|
| 7 |
+
- keras
|
| 8 |
+
- embedded-ai
|
| 9 |
+
- raspberry-pi
|
| 10 |
+
- acoustic-event-detection
|
| 11 |
+
datasets:
|
| 12 |
+
- karolpiczak/ESC-50
|
| 13 |
+
- danavery/urbansound8K
|
| 14 |
+
- FSD50K
|
| 15 |
+
metrics:
|
| 16 |
+
- accuracy
|
| 17 |
+
- f1
|
| 18 |
+
---
|
| 19 |
+
|
| 20 |
+
# On-device Acoustic Alert System - 5-Class Baseline
|
| 21 |
+
|
| 22 |
+
This repository contains the current lightweight CNN baseline for a Raspberry Pi on-device acoustic alert system.
|
| 23 |
+
|
| 24 |
+
## Classes
|
| 25 |
+
|
| 26 |
+
```text
|
| 27 |
+
background
|
| 28 |
+
dog_bark
|
| 29 |
+
alarm_siren
|
| 30 |
+
door_event
|
| 31 |
+
scream_shout
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
`baby_cry` and `glass_break` were removed from this baseline because the available data was insufficient or unstable for a reliable first deployable model.
|
| 35 |
+
|
| 36 |
+
## Model
|
| 37 |
+
|
| 38 |
+
- Framework: TensorFlow/Keras
|
| 39 |
+
- Architecture: Lightweight CNN
|
| 40 |
+
- Input: normalized Log-Mel Spectrogram, shape `(64, 64, 1)`
|
| 41 |
+
- Parameters: about 28k
|
| 42 |
+
- Intended deployment path: TensorFlow Lite / INT8 quantization in the next project stage
|
| 43 |
+
|
| 44 |
+
## Feature Extraction
|
| 45 |
+
|
| 46 |
+
Training and inference must use the same parameters:
|
| 47 |
+
|
| 48 |
+
```text
|
| 49 |
+
sample_rate = 16000
|
| 50 |
+
clip_seconds = 2
|
| 51 |
+
n_mels = 64
|
| 52 |
+
n_fft = 1024
|
| 53 |
+
hop_length = 512
|
| 54 |
+
```
|
| 55 |
+
|
| 56 |
+
Normalization parameters are stored in `normalization.json`.
|
| 57 |
+
|
| 58 |
+
## Evaluation
|
| 59 |
+
|
| 60 |
+
Test results for `best_model.keras`:
|
| 61 |
+
|
| 62 |
+
| metric | value |
|
| 63 |
+
| --- | ---: |
|
| 64 |
+
| accuracy | 0.6954 |
|
| 65 |
+
| macro F1 | 0.5402 |
|
| 66 |
+
| mean inference latency | 43.88 ms |
|
| 67 |
+
|
| 68 |
+
Per-class F1:
|
| 69 |
+
|
| 70 |
+
| class | F1 |
|
| 71 |
+
| --- | ---: |
|
| 72 |
+
| background | 0.7962 |
|
| 73 |
+
| dog_bark | 0.4806 |
|
| 74 |
+
| alarm_siren | 0.5023 |
|
| 75 |
+
| door_event | 0.4579 |
|
| 76 |
+
| scream_shout | 0.4638 |
|
| 77 |
+
|
| 78 |
+
Confidence-threshold behavior:
|
| 79 |
+
|
| 80 |
+
| threshold | accuracy | macro F1 | background false-alert rate | target detection rate |
|
| 81 |
+
| --- | ---: | ---: | ---: | ---: |
|
| 82 |
+
| 0.65 | 0.7803 | 0.6105 | 0.1378 | 0.5801 |
|
| 83 |
+
| 0.75 | 0.7970 | 0.6191 | 0.0976 | 0.5096 |
|
| 84 |
+
| 0.80 | 0.8035 | 0.6184 | 0.0788 | 0.4720 |
|
| 85 |
+
|
| 86 |
+
For long-running alerting, use thresholding plus alert smoothing and cooldown.
|
| 87 |
+
|
| 88 |
+
## Files
|
| 89 |
+
|
| 90 |
+
- `best_model.keras`: best validation checkpoint
|
| 91 |
+
- `final_model.keras`: final training checkpoint
|
| 92 |
+
- `label_map.json`: label order used by model outputs
|
| 93 |
+
- `normalization.json`: feature normalization and extraction parameters
|
| 94 |
+
- `metrics.json`: test metrics
|
| 95 |
+
- `classification_report.txt`: per-class report
|
| 96 |
+
- `confidence_threshold_sweep.json`: threshold trade-off table
|
| 97 |
+
- `confusion_matrix.png`: confusion matrix plot
|
| 98 |
+
- `training_summary.json`: training run summary
|
| 99 |
+
|
| 100 |
+
## Limitations
|
| 101 |
+
|
| 102 |
+
This is a course-project baseline, not a production safety system.
|
| 103 |
+
|
| 104 |
+
- It does not save or upload raw audio.
|
| 105 |
+
- It does not perform speech recognition.
|
| 106 |
+
- It detects sound event categories only.
|
| 107 |
+
- Performance on Raspberry Pi microphone audio still needs device-side validation.
|
best_model.keras
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:cfb7b535336f39258a7ff6d3d9436a1a390fdfd0fcbf9a84dc0054064f763ff8
|
| 3 |
+
size 407139
|
classification_report.txt
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
precision recall f1-score support
|
| 2 |
+
|
| 3 |
+
background 0.90 0.71 0.80 3831
|
| 4 |
+
dog_bark 0.36 0.71 0.48 226
|
| 5 |
+
alarm_siren 0.44 0.59 0.50 635
|
| 6 |
+
door_event 0.32 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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"split": "test",
|
| 3 |
+
"labels": [
|
| 4 |
+
"background",
|
| 5 |
+
"dog_bark",
|
| 6 |
+
"alarm_siren",
|
| 7 |
+
"door_event",
|
| 8 |
+
"scream_shout"
|
| 9 |
+
],
|
| 10 |
+
"background_id": 0,
|
| 11 |
+
"threshold_policy": "If top prediction is a non-background class and confidence is below threshold, output background.",
|
| 12 |
+
"thresholds": {
|
| 13 |
+
"0.0": {
|
| 14 |
+
"accuracy": 0.6954124827721992,
|
| 15 |
+
"macro_precision": 0.4785615211327133,
|
| 16 |
+
"macro_recall": 0.683787415881107,
|
| 17 |
+
"macro_f1": 0.5401677278598453,
|
| 18 |
+
"background_false_alerts": 1093,
|
| 19 |
+
"background_false_alert_rate": 0.285304098146698,
|
| 20 |
+
"target_hits": 939,
|
| 21 |
+
"target_misses_to_background": 309,
|
| 22 |
+
"target_detection_rate": 0.7524038461538461,
|
| 23 |
+
"per_class": {
|
| 24 |
+
"background": {
|
| 25 |
+
"precision": 0.8985887758450936,
|
| 26 |
+
"recall": 0.714695901853302,
|
| 27 |
+
"f1": 0.7961616749054958,
|
| 28 |
+
"support": 3831
|
| 29 |
+
},
|
| 30 |
+
"dog_bark": {
|
| 31 |
+
"precision": 0.36261261261261263,
|
| 32 |
+
"recall": 0.7123893805309734,
|
| 33 |
+
"f1": 0.48059701492537316,
|
| 34 |
+
"support": 226
|
| 35 |
+
},
|
| 36 |
+
"alarm_siren": {
|
| 37 |
+
"precision": 0.4361948955916473,
|
| 38 |
+
"recall": 0.5921259842519685,
|
| 39 |
+
"f1": 0.5023380093520374,
|
| 40 |
+
"support": 635
|
| 41 |
+
},
|
| 42 |
+
"door_event": {
|
| 43 |
+
"precision": 0.32342007434944237,
|
| 44 |
+
"recall": 0.7837837837837838,
|
| 45 |
+
"f1": 0.45789473684210524,
|
| 46 |
+
"support": 111
|
| 47 |
+
},
|
| 48 |
+
"scream_shout": {
|
| 49 |
+
"precision": 0.37199124726477023,
|
| 50 |
+
"recall": 0.6159420289855072,
|
| 51 |
+
"f1": 0.4638472032742155,
|
| 52 |
+
"support": 276
|
| 53 |
+
}
|
| 54 |
+
}
|
| 55 |
+
},
|
| 56 |
+
"0.4": {
|
| 57 |
+
"accuracy": 0.7050600511911793,
|
| 58 |
+
"macro_precision": 0.4881460770540735,
|
| 59 |
+
"macro_recall": 0.6836289748301112,
|
| 60 |
+
"macro_f1": 0.5495130654668229,
|
| 61 |
+
"background_false_alerts": 1038,
|
| 62 |
+
"background_false_alert_rate": 0.27094753328112764,
|
| 63 |
+
"target_hits": 917,
|
| 64 |
+
"target_misses_to_background": 331,
|
| 65 |
+
"target_detection_rate": 0.7347756410256411,
|
| 66 |
+
"per_class": {
|
| 67 |
+
"background": {
|
| 68 |
+
"precision": 0.8940460947503202,
|
| 69 |
+
"recall": 0.7290524667188724,
|
| 70 |
+
"f1": 0.8031631919482387,
|
| 71 |
+
"support": 3831
|
| 72 |
+
},
|
| 73 |
+
"dog_bark": {
|
| 74 |
+
"precision": 0.37857142857142856,
|
| 75 |
+
"recall": 0.7035398230088495,
|
| 76 |
+
"f1": 0.49226006191950467,
|
| 77 |
+
"support": 226
|
| 78 |
+
},
|
| 79 |
+
"alarm_siren": {
|
| 80 |
+
"precision": 0.4449760765550239,
|
| 81 |
+
"recall": 0.5858267716535434,
|
| 82 |
+
"f1": 0.5057783820530252,
|
| 83 |
+
"support": 635
|
| 84 |
+
},
|
| 85 |
+
"door_event": {
|
| 86 |
+
"precision": 0.33852140077821014,
|
| 87 |
+
"recall": 0.7837837837837838,
|
| 88 |
+
"f1": 0.47282608695652173,
|
| 89 |
+
"support": 111
|
| 90 |
+
},
|
| 91 |
+
"scream_shout": {
|
| 92 |
+
"precision": 0.38461538461538464,
|
| 93 |
+
"recall": 0.6159420289855072,
|
| 94 |
+
"f1": 0.4735376044568245,
|
| 95 |
+
"support": 276
|
| 96 |
+
}
|
| 97 |
+
}
|
| 98 |
+
},
|
| 99 |
+
"0.5": {
|
| 100 |
+
"accuracy": 0.7395156526875369,
|
| 101 |
+
"macro_precision": 0.5322276220267105,
|
| 102 |
+
"macro_recall": 0.670634249081814,
|
| 103 |
+
"macro_f1": 0.584966696328538,
|
| 104 |
+
"background_false_alerts": 825,
|
| 105 |
+
"background_false_alert_rate": 0.2153484729835552,
|
| 106 |
+
"target_hits": 849,
|
| 107 |
+
"target_misses_to_background": 399,
|
| 108 |
+
"target_detection_rate": 0.6802884615384616,
|
| 109 |
+
"per_class": {
|
| 110 |
+
"background": {
|
| 111 |
+
"precision": 0.8828193832599119,
|
| 112 |
+
"recall": 0.7846515270164448,
|
| 113 |
+
"f1": 0.8308457711442786,
|
| 114 |
+
"support": 3831
|
| 115 |
+
},
|
| 116 |
+
"dog_bark": {
|
| 117 |
+
"precision": 0.43641618497109824,
|
| 118 |
+
"recall": 0.668141592920354,
|
| 119 |
+
"f1": 0.527972027972028,
|
| 120 |
+
"support": 226
|
| 121 |
+
},
|
| 122 |
+
"alarm_siren": {
|
| 123 |
+
"precision": 0.4666666666666667,
|
| 124 |
+
"recall": 0.5511811023622047,
|
| 125 |
+
"f1": 0.5054151624548736,
|
| 126 |
+
"support": 635
|
| 127 |
+
},
|
| 128 |
+
"door_event": {
|
| 129 |
+
"precision": 0.45604395604395603,
|
| 130 |
+
"recall": 0.7477477477477478,
|
| 131 |
+
"f1": 0.5665529010238908,
|
| 132 |
+
"support": 111
|
| 133 |
+
},
|
| 134 |
+
"scream_shout": {
|
| 135 |
+
"precision": 0.41919191919191917,
|
| 136 |
+
"recall": 0.6014492753623188,
|
| 137 |
+
"f1": 0.49404761904761907,
|
| 138 |
+
"support": 276
|
| 139 |
+
}
|
| 140 |
+
}
|
| 141 |
+
},
|
| 142 |
+
"0.6": {
|
| 143 |
+
"accuracy": 0.7676708013388462,
|
| 144 |
+
"macro_precision": 0.5719646609445405,
|
| 145 |
+
"macro_recall": 0.6502101795683431,
|
| 146 |
+
"macro_f1": 0.6046756023804498,
|
| 147 |
+
"background_false_alerts": 623,
|
| 148 |
+
"background_false_alert_rate": 0.16262072565909685,
|
| 149 |
+
"target_hits": 763,
|
| 150 |
+
"target_misses_to_background": 485,
|
| 151 |
+
"target_detection_rate": 0.6113782051282052,
|
| 152 |
+
"per_class": {
|
| 153 |
+
"background": {
|
| 154 |
+
"precision": 0.8686704576225291,
|
| 155 |
+
"recall": 0.8373792743409032,
|
| 156 |
+
"f1": 0.8527379053694844,
|
| 157 |
+
"support": 3831
|
| 158 |
+
},
|
| 159 |
+
"dog_bark": {
|
| 160 |
+
"precision": 0.5272727272727272,
|
| 161 |
+
"recall": 0.6415929203539823,
|
| 162 |
+
"f1": 0.5788423153692615,
|
| 163 |
+
"support": 226
|
| 164 |
+
},
|
| 165 |
+
"alarm_siren": {
|
| 166 |
+
"precision": 0.5140495867768595,
|
| 167 |
+
"recall": 0.48976377952755906,
|
| 168 |
+
"f1": 0.5016129032258064,
|
| 169 |
+
"support": 635
|
| 170 |
+
},
|
| 171 |
+
"door_event": {
|
| 172 |
+
"precision": 0.5031446540880503,
|
| 173 |
+
"recall": 0.7207207207207207,
|
| 174 |
+
"f1": 0.5925925925925926,
|
| 175 |
+
"support": 111
|
| 176 |
+
},
|
| 177 |
+
"scream_shout": {
|
| 178 |
+
"precision": 0.44668587896253603,
|
| 179 |
+
"recall": 0.5615942028985508,
|
| 180 |
+
"f1": 0.49759229534510435,
|
| 181 |
+
"support": 276
|
| 182 |
+
}
|
| 183 |
+
}
|
| 184 |
+
},
|
| 185 |
+
"0.65": {
|
| 186 |
+
"accuracy": 0.7802717070289427,
|
| 187 |
+
"macro_precision": 0.5922215887840118,
|
| 188 |
+
"macro_recall": 0.6373473645630556,
|
| 189 |
+
"macro_f1": 0.6105274551560768,
|
| 190 |
+
"background_false_alerts": 528,
|
| 191 |
+
"background_false_alert_rate": 0.13782302270947533,
|
| 192 |
+
"target_hits": 724,
|
| 193 |
+
"target_misses_to_background": 524,
|
| 194 |
+
"target_detection_rate": 0.5801282051282052,
|
| 195 |
+
"per_class": {
|
| 196 |
+
"background": {
|
| 197 |
+
"precision": 0.8630781290828325,
|
| 198 |
+
"recall": 0.8621769772905247,
|
| 199 |
+
"f1": 0.8626273178375555,
|
| 200 |
+
"support": 3831
|
| 201 |
+
},
|
| 202 |
+
"dog_bark": {
|
| 203 |
+
"precision": 0.5697211155378487,
|
| 204 |
+
"recall": 0.6327433628318584,
|
| 205 |
+
"f1": 0.59958071278826,
|
| 206 |
+
"support": 226
|
| 207 |
+
},
|
| 208 |
+
"alarm_siren": {
|
| 209 |
+
"precision": 0.5449438202247191,
|
| 210 |
+
"recall": 0.4582677165354331,
|
| 211 |
+
"f1": 0.49786142001710865,
|
| 212 |
+
"support": 635
|
| 213 |
+
},
|
| 214 |
+
"door_event": {
|
| 215 |
+
"precision": 0.5133333333333333,
|
| 216 |
+
"recall": 0.6936936936936937,
|
| 217 |
+
"f1": 0.5900383141762452,
|
| 218 |
+
"support": 111
|
| 219 |
+
},
|
| 220 |
+
"scream_shout": {
|
| 221 |
+
"precision": 0.47003154574132494,
|
| 222 |
+
"recall": 0.5398550724637681,
|
| 223 |
+
"f1": 0.5025295109612141,
|
| 224 |
+
"support": 276
|
| 225 |
+
}
|
| 226 |
+
}
|
| 227 |
+
},
|
| 228 |
+
"0.7": {
|
| 229 |
+
"accuracy": 0.7912974995077772,
|
| 230 |
+
"macro_precision": 0.6194682599995388,
|
| 231 |
+
"macro_recall": 0.6247916951729758,
|
| 232 |
+
"macro_f1": 0.6183632029446662,
|
| 233 |
+
"background_false_alerts": 438,
|
| 234 |
+
"background_false_alert_rate": 0.11433046202036022,
|
| 235 |
+
"target_hits": 679,
|
| 236 |
+
"target_misses_to_background": 569,
|
| 237 |
+
"target_detection_rate": 0.5440705128205128,
|
| 238 |
+
"per_class": {
|
| 239 |
+
"background": {
|
| 240 |
+
"precision": 0.8563856638061585,
|
| 241 |
+
"recall": 0.8856695379796398,
|
| 242 |
+
"f1": 0.870781470550494,
|
| 243 |
+
"support": 3831
|
| 244 |
+
},
|
| 245 |
+
"dog_bark": {
|
| 246 |
+
"precision": 0.6008771929824561,
|
| 247 |
+
"recall": 0.6061946902654868,
|
| 248 |
+
"f1": 0.6035242290748899,
|
| 249 |
+
"support": 226
|
| 250 |
+
},
|
| 251 |
+
"alarm_siren": {
|
| 252 |
+
"precision": 0.5788336933045356,
|
| 253 |
+
"recall": 0.4220472440944882,
|
| 254 |
+
"f1": 0.48816029143898,
|
| 255 |
+
"support": 635
|
| 256 |
+
},
|
| 257 |
+
"door_event": {
|
| 258 |
+
"precision": 0.562962962962963,
|
| 259 |
+
"recall": 0.6846846846846847,
|
| 260 |
+
"f1": 0.6178861788617886,
|
| 261 |
+
"support": 111
|
| 262 |
+
},
|
| 263 |
+
"scream_shout": {
|
| 264 |
+
"precision": 0.49828178694158076,
|
| 265 |
+
"recall": 0.5253623188405797,
|
| 266 |
+
"f1": 0.5114638447971781,
|
| 267 |
+
"support": 276
|
| 268 |
+
}
|
| 269 |
+
}
|
| 270 |
+
},
|
| 271 |
+
"0.75": {
|
| 272 |
+
"accuracy": 0.7970072848986021,
|
| 273 |
+
"macro_precision": 0.6391869562730029,
|
| 274 |
+
"macro_recall": 0.610572168240029,
|
| 275 |
+
"macro_f1": 0.6190753438948531,
|
| 276 |
+
"background_false_alerts": 374,
|
| 277 |
+
"background_false_alert_rate": 0.09762464108587836,
|
| 278 |
+
"target_hits": 636,
|
| 279 |
+
"target_misses_to_background": 612,
|
| 280 |
+
"target_detection_rate": 0.5096153846153846,
|
| 281 |
+
"per_class": {
|
| 282 |
+
"background": {
|
| 283 |
+
"precision": 0.8495944949619071,
|
| 284 |
+
"recall": 0.9023753589141217,
|
| 285 |
+
"f1": 0.8751898734177215,
|
| 286 |
+
"support": 3831
|
| 287 |
+
},
|
| 288 |
+
"dog_bark": {
|
| 289 |
+
"precision": 0.6470588235294118,
|
| 290 |
+
"recall": 0.584070796460177,
|
| 291 |
+
"f1": 0.6139534883720931,
|
| 292 |
+
"support": 226
|
| 293 |
+
},
|
| 294 |
+
"alarm_siren": {
|
| 295 |
+
"precision": 0.5995145631067961,
|
| 296 |
+
"recall": 0.3889763779527559,
|
| 297 |
+
"f1": 0.47182425978987586,
|
| 298 |
+
"support": 635
|
| 299 |
+
},
|
| 300 |
+
"door_event": {
|
| 301 |
+
"precision": 0.5846153846153846,
|
| 302 |
+
"recall": 0.6846846846846847,
|
| 303 |
+
"f1": 0.6307053941908713,
|
| 304 |
+
"support": 111
|
| 305 |
+
},
|
| 306 |
+
"scream_shout": {
|
| 307 |
+
"precision": 0.5151515151515151,
|
| 308 |
+
"recall": 0.4927536231884058,
|
| 309 |
+
"f1": 0.5037037037037037,
|
| 310 |
+
"support": 276
|
| 311 |
+
}
|
| 312 |
+
}
|
| 313 |
+
},
|
| 314 |
+
"0.8": {
|
| 315 |
+
"accuracy": 0.8035046268950581,
|
| 316 |
+
"macro_precision": 0.6632338597788647,
|
| 317 |
+
"macro_recall": 0.595733588505752,
|
| 318 |
+
"macro_f1": 0.6183674611765237,
|
| 319 |
+
"background_false_alerts": 302,
|
| 320 |
+
"background_false_alert_rate": 0.07883059253458627,
|
| 321 |
+
"target_hits": 589,
|
| 322 |
+
"target_misses_to_background": 659,
|
| 323 |
+
"target_detection_rate": 0.4719551282051282,
|
| 324 |
+
"per_class": {
|
| 325 |
+
"background": {
|
| 326 |
+
"precision": 0.8426456542502387,
|
| 327 |
+
"recall": 0.9211694074654138,
|
| 328 |
+
"f1": 0.8801596209003616,
|
| 329 |
+
"support": 3831
|
| 330 |
+
},
|
| 331 |
+
"dog_bark": {
|
| 332 |
+
"precision": 0.6735751295336787,
|
| 333 |
+
"recall": 0.5752212389380531,
|
| 334 |
+
"f1": 0.6205250596658711,
|
| 335 |
+
"support": 226
|
| 336 |
+
},
|
| 337 |
+
"alarm_siren": {
|
| 338 |
+
"precision": 0.6470588235294118,
|
| 339 |
+
"recall": 0.3464566929133858,
|
| 340 |
+
"f1": 0.4512820512820513,
|
| 341 |
+
"support": 635
|
| 342 |
+
},
|
| 343 |
+
"door_event": {
|
| 344 |
+
"precision": 0.6147540983606558,
|
| 345 |
+
"recall": 0.6756756756756757,
|
| 346 |
+
"f1": 0.6437768240343348,
|
| 347 |
+
"support": 111
|
| 348 |
+
},
|
| 349 |
+
"scream_shout": {
|
| 350 |
+
"precision": 0.538135593220339,
|
| 351 |
+
"recall": 0.4601449275362319,
|
| 352 |
+
"f1": 0.49609375,
|
| 353 |
+
"support": 276
|
| 354 |
+
}
|
| 355 |
+
}
|
| 356 |
+
},
|
| 357 |
+
"0.85": {
|
| 358 |
+
"accuracy": 0.8064579641661744,
|
| 359 |
+
"macro_precision": 0.690624826615986,
|
| 360 |
+
"macro_recall": 0.5750611724190517,
|
| 361 |
+
"macro_f1": 0.6136025512101229,
|
| 362 |
+
"background_false_alerts": 239,
|
| 363 |
+
"background_false_alert_rate": 0.06238580005220569,
|
| 364 |
+
"target_hits": 535,
|
| 365 |
+
"target_misses_to_background": 713,
|
| 366 |
+
"target_detection_rate": 0.4286858974358974,
|
| 367 |
+
"per_class": {
|
| 368 |
+
"background": {
|
| 369 |
+
"precision": 0.8343786295005807,
|
| 370 |
+
"recall": 0.9376141999477943,
|
| 371 |
+
"f1": 0.8829891838741396,
|
| 372 |
+
"support": 3831
|
| 373 |
+
},
|
| 374 |
+
"dog_bark": {
|
| 375 |
+
"precision": 0.7102272727272727,
|
| 376 |
+
"recall": 0.5530973451327433,
|
| 377 |
+
"f1": 0.6218905472636815,
|
| 378 |
+
"support": 226
|
| 379 |
+
},
|
| 380 |
+
"alarm_siren": {
|
| 381 |
+
"precision": 0.6798561151079137,
|
| 382 |
+
"recall": 0.29763779527559053,
|
| 383 |
+
"f1": 0.4140197152245345,
|
| 384 |
+
"support": 635
|
| 385 |
+
},
|
| 386 |
+
"door_event": {
|
| 387 |
+
"precision": 0.6788990825688074,
|
| 388 |
+
"recall": 0.6666666666666666,
|
| 389 |
+
"f1": 0.6727272727272727,
|
| 390 |
+
"support": 111
|
| 391 |
+
},
|
| 392 |
+
"scream_shout": {
|
| 393 |
+
"precision": 0.5497630331753555,
|
| 394 |
+
"recall": 0.42028985507246375,
|
| 395 |
+
"f1": 0.47638603696098564,
|
| 396 |
+
"support": 276
|
| 397 |
+
}
|
| 398 |
+
}
|
| 399 |
+
},
|
| 400 |
+
"0.9": {
|
| 401 |
+
"accuracy": 0.8137428627682615,
|
| 402 |
+
"macro_precision": 0.7460151376744764,
|
| 403 |
+
"macro_recall": 0.5543167014058634,
|
| 404 |
+
"macro_f1": 0.61228302931239,
|
| 405 |
+
"background_false_alerts": 154,
|
| 406 |
+
"background_false_alert_rate": 0.04019838162359697,
|
| 407 |
+
"target_hits": 475,
|
| 408 |
+
"target_misses_to_background": 773,
|
| 409 |
+
"target_detection_rate": 0.38060897435897434,
|
| 410 |
+
"per_class": {
|
| 411 |
+
"background": {
|
| 412 |
+
"precision": 0.8262921348314607,
|
| 413 |
+
"recall": 0.959801618376403,
|
| 414 |
+
"f1": 0.8880569979471078,
|
| 415 |
+
"support": 3831
|
| 416 |
+
},
|
| 417 |
+
"dog_bark": {
|
| 418 |
+
"precision": 0.7908496732026143,
|
| 419 |
+
"recall": 0.5353982300884956,
|
| 420 |
+
"f1": 0.6385224274406333,
|
| 421 |
+
"support": 226
|
| 422 |
+
},
|
| 423 |
+
"alarm_siren": {
|
| 424 |
+
"precision": 0.7699530516431925,
|
| 425 |
+
"recall": 0.25826771653543307,
|
| 426 |
+
"f1": 0.3867924528301887,
|
| 427 |
+
"support": 635
|
| 428 |
+
},
|
| 429 |
+
"door_event": {
|
| 430 |
+
"precision": 0.7551020408163265,
|
| 431 |
+
"recall": 0.6666666666666666,
|
| 432 |
+
"f1": 0.7081339712918661,
|
| 433 |
+
"support": 111
|
| 434 |
+
},
|
| 435 |
+
"scream_shout": {
|
| 436 |
+
"precision": 0.5878787878787879,
|
| 437 |
+
"recall": 0.35144927536231885,
|
| 438 |
+
"f1": 0.4399092970521542,
|
| 439 |
+
"support": 276
|
| 440 |
+
}
|
| 441 |
+
}
|
| 442 |
+
}
|
| 443 |
+
}
|
| 444 |
+
}
|
confusion_matrix.png
ADDED
|
Git LFS Details
|
final_model.keras
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:eaf2581dd8a008c83063882b48dabe7592f3bc2355f46fa9c9fbdc3799ec85e8
|
| 3 |
+
size 407139
|
label_map.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"labels": [
|
| 3 |
+
"background",
|
| 4 |
+
"dog_bark",
|
| 5 |
+
"alarm_siren",
|
| 6 |
+
"door_event",
|
| 7 |
+
"scream_shout"
|
| 8 |
+
],
|
| 9 |
+
"label_to_id": {
|
| 10 |
+
"background": 0,
|
| 11 |
+
"dog_bark": 1,
|
| 12 |
+
"alarm_siren": 2,
|
| 13 |
+
"door_event": 3,
|
| 14 |
+
"scream_shout": 4
|
| 15 |
+
},
|
| 16 |
+
"id_to_label": {
|
| 17 |
+
"0": "background",
|
| 18 |
+
"1": "dog_bark",
|
| 19 |
+
"2": "alarm_siren",
|
| 20 |
+
"3": "door_event",
|
| 21 |
+
"4": "scream_shout"
|
| 22 |
+
},
|
| 23 |
+
"missing_labels": [
|
| 24 |
+
"baby_cry",
|
| 25 |
+
"glass_break"
|
| 26 |
+
],
|
| 27 |
+
"canonical_labels": [
|
| 28 |
+
"background",
|
| 29 |
+
"baby_cry",
|
| 30 |
+
"dog_bark",
|
| 31 |
+
"alarm_siren",
|
| 32 |
+
"door_event",
|
| 33 |
+
"glass_break",
|
| 34 |
+
"scream_shout"
|
| 35 |
+
]
|
| 36 |
+
}
|
metrics.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"split": "test",
|
| 3 |
+
"accuracy": 0.6954124827721992,
|
| 4 |
+
"macro_precision": 0.4785615211327133,
|
| 5 |
+
"macro_recall": 0.683787415881107,
|
| 6 |
+
"macro_f1": 0.5401677278598453,
|
| 7 |
+
"per_class": {
|
| 8 |
+
"background": {
|
| 9 |
+
"precision": 0.8985887758450936,
|
| 10 |
+
"recall": 0.714695901853302,
|
| 11 |
+
"f1": 0.7961616749054958,
|
| 12 |
+
"support": 3831
|
| 13 |
+
},
|
| 14 |
+
"dog_bark": {
|
| 15 |
+
"precision": 0.36261261261261263,
|
| 16 |
+
"recall": 0.7123893805309734,
|
| 17 |
+
"f1": 0.48059701492537316,
|
| 18 |
+
"support": 226
|
| 19 |
+
},
|
| 20 |
+
"alarm_siren": {
|
| 21 |
+
"precision": 0.4361948955916473,
|
| 22 |
+
"recall": 0.5921259842519685,
|
| 23 |
+
"f1": 0.5023380093520374,
|
| 24 |
+
"support": 635
|
| 25 |
+
},
|
| 26 |
+
"door_event": {
|
| 27 |
+
"precision": 0.32342007434944237,
|
| 28 |
+
"recall": 0.7837837837837838,
|
| 29 |
+
"f1": 0.45789473684210524,
|
| 30 |
+
"support": 111
|
| 31 |
+
},
|
| 32 |
+
"scream_shout": {
|
| 33 |
+
"precision": 0.37199124726477023,
|
| 34 |
+
"recall": 0.6159420289855072,
|
| 35 |
+
"f1": 0.4638472032742155,
|
| 36 |
+
"support": 276
|
| 37 |
+
}
|
| 38 |
+
},
|
| 39 |
+
"confusion_matrix": [
|
| 40 |
+
[
|
| 41 |
+
2738,
|
| 42 |
+
229,
|
| 43 |
+
460,
|
| 44 |
+
159,
|
| 45 |
+
245
|
| 46 |
+
],
|
| 47 |
+
[
|
| 48 |
+
34,
|
| 49 |
+
161,
|
| 50 |
+
11,
|
| 51 |
+
6,
|
| 52 |
+
14
|
| 53 |
+
],
|
| 54 |
+
[
|
| 55 |
+
193,
|
| 56 |
+
24,
|
| 57 |
+
376,
|
| 58 |
+
14,
|
| 59 |
+
28
|
| 60 |
+
],
|
| 61 |
+
[
|
| 62 |
+
16,
|
| 63 |
+
7,
|
| 64 |
+
1,
|
| 65 |
+
87,
|
| 66 |
+
0
|
| 67 |
+
],
|
| 68 |
+
[
|
| 69 |
+
66,
|
| 70 |
+
23,
|
| 71 |
+
14,
|
| 72 |
+
3,
|
| 73 |
+
170
|
| 74 |
+
]
|
| 75 |
+
],
|
| 76 |
+
"inference_latency": {
|
| 77 |
+
"mean_ms": 43.87880890397355,
|
| 78 |
+
"median_ms": 43.45465847291052,
|
| 79 |
+
"p95_ms": 46.91382271703333,
|
| 80 |
+
"min_ms": 40.953397983685136,
|
| 81 |
+
"max_ms": 48.14268997870386
|
| 82 |
+
},
|
| 83 |
+
"num_samples": 5079,
|
| 84 |
+
"labels": [
|
| 85 |
+
"background",
|
| 86 |
+
"dog_bark",
|
| 87 |
+
"alarm_siren",
|
| 88 |
+
"door_event",
|
| 89 |
+
"scream_shout"
|
| 90 |
+
]
|
| 91 |
+
}
|
normalization.json
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"mean": -41.9937364935039,
|
| 3 |
+
"std": 17.41233292211895,
|
| 4 |
+
"feature_shape": [
|
| 5 |
+
64,
|
| 6 |
+
64
|
| 7 |
+
],
|
| 8 |
+
"sample_rate": 16000,
|
| 9 |
+
"clip_seconds": 2.0,
|
| 10 |
+
"n_mels": 64,
|
| 11 |
+
"n_fft": 1024,
|
| 12 |
+
"hop_length": 512,
|
| 13 |
+
"fmin": 50.0,
|
| 14 |
+
"fmax": 8000.0,
|
| 15 |
+
"power_to_db_ref": "np.max",
|
| 16 |
+
"feature_backend": "soundfile_scipy"
|
| 17 |
+
}
|
training_summary.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"labels": [
|
| 3 |
+
"background",
|
| 4 |
+
"dog_bark",
|
| 5 |
+
"alarm_siren",
|
| 6 |
+
"door_event",
|
| 7 |
+
"scream_shout"
|
| 8 |
+
],
|
| 9 |
+
"num_classes": 5,
|
| 10 |
+
"train_samples": 22105,
|
| 11 |
+
"val_samples": 2652,
|
| 12 |
+
"best_val_loss": 0.7007942795753479,
|
| 13 |
+
"best_val_accuracy": 0.7258672714233398,
|
| 14 |
+
"input_shape": [
|
| 15 |
+
64,
|
| 16 |
+
64,
|
| 17 |
+
1
|
| 18 |
+
],
|
| 19 |
+
"epochs_ran": 60
|
| 20 |
+
}
|