Update README.md
Browse files
README.md
CHANGED
|
@@ -6,31 +6,111 @@ tags:
|
|
| 6 |
- embedded
|
| 7 |
- cpp
|
| 8 |
- audio
|
| 9 |
-
- wake
|
| 10 |
- kws
|
| 11 |
-
-
|
| 12 |
-
-
|
|
|
|
|
|
|
| 13 |
pipeline_tag: audio-classification
|
| 14 |
---
|
| 15 |
|
| 16 |
# Hey-Edge
|
| 17 |
|
| 18 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
|
| 20 |
## Model details
|
| 21 |
|
| 22 |
| Field | Value |
|
| 23 |
|---|---|
|
|
|
|
|
|
|
|
|
|
| 24 |
| Export type | Edge Impulse C++ library |
|
| 25 |
-
| Modality |
|
| 26 |
-
| Sensor |
|
| 27 |
| Sample frequency | 16000 Hz |
|
| 28 |
| Input feature count | 3960 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 30 |
|
| 31 |
## Files in this repository
|
| 32 |
|
| 33 |
-
```
|
| 34 |
CMakeLists.txt
|
| 35 |
README.txt
|
| 36 |
edge-impulse-sdk/
|
|
@@ -41,46 +121,169 @@ tflite-model/tflite_learn_1052106_5_compiled.h
|
|
| 41 |
tflite-model/trained_model_ops_define.h
|
| 42 |
```
|
| 43 |
|
| 44 |
-
##
|
| 45 |
-
|
| 46 |
-
### Build the C++ library
|
| 47 |
|
| 48 |
```bash
|
| 49 |
pip install huggingface_hub
|
| 50 |
-
hf download edgeimpulse/Hey-Edge --local-dir ./
|
| 51 |
-
cd impulse
|
| 52 |
-
# Standalone example (from the Edge Impulse C++ SDK):
|
| 53 |
-
make -j
|
| 54 |
-
./build/edge-impulse-standalone <features.txt>
|
| 55 |
```
|
| 56 |
|
| 57 |
-
|
| 58 |
-
`tflite-model/`. Integrate it into your firmware/app per the Edge Impulse C++
|
| 59 |
-
inferencing docs: <https://docs.edgeimpulse.com/deploy-your-model/running-your-impulse-locally/deploy-your-impulse-as-a-c-library>
|
| 60 |
-
|
| 61 |
-
### Download from the Hub
|
| 62 |
|
| 63 |
```bash
|
| 64 |
pip install huggingface_hub
|
| 65 |
-
# whole repo:
|
| 66 |
-
hf download edgeimpulse/Hey-Edge --local-dir ./Hey-Edge
|
| 67 |
-
# or a single file:
|
| 68 |
hf download edgeimpulse/Hey-Edge CMakeLists.txt --local-dir .
|
| 69 |
```
|
| 70 |
|
|
|
|
|
|
|
| 71 |
```python
|
| 72 |
from huggingface_hub import hf_hub_download, snapshot_download
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 75 |
```
|
| 76 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
|
| 78 |
-
|
|
|
|
|
|
|
| 79 |
|
| 80 |
-
|
| 81 |
-
published to the Hub. Edge Impulse handles data collection,
|
| 82 |
-
DSP feature extraction and model training; this repo packages the resulting
|
| 83 |
-
deployment artifact plus ready-to-run instructions.
|
| 84 |
|
| 85 |
-
|
| 86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
- embedded
|
| 7 |
- cpp
|
| 8 |
- audio
|
| 9 |
+
- wake-word
|
| 10 |
- kws
|
| 11 |
+
- keyword-spotting
|
| 12 |
+
- microphone
|
| 13 |
+
- synthetic-data
|
| 14 |
+
- hey-edge
|
| 15 |
pipeline_tag: audio-classification
|
| 16 |
---
|
| 17 |
|
| 18 |
# Hey-Edge
|
| 19 |
|
| 20 |
+
Hey-Edge is an audio keyword-spotting wake-word model trained with Edge Impulse to detect the phrase "hey edge" from 16 kHz microphone audio.
|
| 21 |
+
|
| 22 |
+
The model was trained using synthetic and augmented audio and exported as an Edge Impulse C++ library for embedded and TinyML deployment.
|
| 23 |
+
|
| 24 |
+
Live Edge Impulse project: https://studio.edgeimpulse.com/public/1052106/live
|
| 25 |
|
| 26 |
## Model details
|
| 27 |
|
| 28 |
| Field | Value |
|
| 29 |
|---|---|
|
| 30 |
+
| Model name | Hey-Edge |
|
| 31 |
+
| Task | Wake-word keyword spotting |
|
| 32 |
+
| Pipeline tag | audio-classification |
|
| 33 |
| Export type | Edge Impulse C++ library |
|
| 34 |
+
| Modality | Audio |
|
| 35 |
+
| Sensor | Microphone |
|
| 36 |
| Sample frequency | 16000 Hz |
|
| 37 |
| Input feature count | 3960 |
|
| 38 |
+
| Classes | background_noise, hey_edge, unknown |
|
| 39 |
+
| License | Apache 2.0 |
|
| 40 |
+
|
| 41 |
+
## Intended use
|
| 42 |
+
|
| 43 |
+
This model is intended for embedded wake-word detection and TinyML audio classification use cases, including:
|
| 44 |
+
|
| 45 |
+
- Detecting the phrase "hey edge" on-device.
|
| 46 |
+
- Running keyword spotting on microcontrollers, Linux SBCs, or embedded Linux devices.
|
| 47 |
+
- Demonstrating Edge Impulse C++ library deployment.
|
| 48 |
+
- Prototyping custom wake-word interfaces for edge AI systems.
|
| 49 |
+
|
| 50 |
+
This model is not intended for speaker identification, speech recognition, transcription, biometric identification, or security-critical voice authentication.
|
| 51 |
+
|
| 52 |
+
## Training data
|
| 53 |
+
|
| 54 |
+
| Field | Value |
|
| 55 |
+
|---|---|
|
| 56 |
+
| Training data duration | 41 min 50 sec |
|
| 57 |
+
| Number of classes | 3 |
|
| 58 |
+
| Classes | background_noise, hey_edge, unknown |
|
| 59 |
+
| Training windows | 3765 |
|
| 60 |
+
| Data type | Synthetic and augmented audio |
|
| 61 |
+
| Audio sample rate | 16 kHz |
|
| 62 |
+
|
| 63 |
+
## Validation performance
|
| 64 |
+
|
| 65 |
+
| Metric | Value |
|
| 66 |
+
|---|---:|
|
| 67 |
+
| Accuracy | 86.7% |
|
| 68 |
+
| Loss | 0.28 |
|
| 69 |
+
| Area under ROC Curve | 0.97 |
|
| 70 |
+
| Weighted average precision | 0.88 |
|
| 71 |
+
| Weighted average recall | 0.87 |
|
| 72 |
+
| Weighted average F1 score | 0.87 |
|
| 73 |
+
|
| 74 |
+
## Per-class F1 score
|
| 75 |
+
|
| 76 |
+
| Class | F1 score |
|
| 77 |
+
|---|---:|
|
| 78 |
+
| background_noise | 0.99 |
|
| 79 |
+
| hey_edge | 0.75 |
|
| 80 |
+
| unknown | 0.90 |
|
| 81 |
+
|
| 82 |
+
## Confusion matrix
|
| 83 |
+
|
| 84 |
+
| Actual / Predicted | background_noise | hey_edge | unknown |
|
| 85 |
+
|---|---:|---:|---:|
|
| 86 |
+
| background_noise | 100.0% | 0.0% | 0.0% |
|
| 87 |
+
| hey_edge | 0.7% | 85.5% | 13.8% |
|
| 88 |
+
| unknown | 0.0% | 14.5% | 85.5% |
|
| 89 |
+
|
| 90 |
+
The main observed failure mode is confusion between hey_edge and unknown.
|
| 91 |
+
|
| 92 |
+
## On-device performance
|
| 93 |
+
|
| 94 |
+
### Full impulse inference
|
| 95 |
+
|
| 96 |
+
| Metric | Value |
|
| 97 |
+
|---|---:|
|
| 98 |
+
| Inferencing time | 655 ms |
|
| 99 |
+
| Peak RAM usage | 166.2 KB |
|
| 100 |
+
| Flash usage | 535.2 KB |
|
| 101 |
|
| 102 |
+
### Feature generation
|
| 103 |
+
|
| 104 |
+
| Metric | Value |
|
| 105 |
+
|---|---:|
|
| 106 |
+
| Processing time | 250 ms |
|
| 107 |
+
| Peak RAM usage | 20 KB |
|
| 108 |
+
|
| 109 |
+
Actual performance will vary depending on target hardware, compiler options, DSP settings, and inference engine.
|
| 110 |
|
| 111 |
## Files in this repository
|
| 112 |
|
| 113 |
+
```text
|
| 114 |
CMakeLists.txt
|
| 115 |
README.txt
|
| 116 |
edge-impulse-sdk/
|
|
|
|
| 121 |
tflite-model/trained_model_ops_define.h
|
| 122 |
```
|
| 123 |
|
| 124 |
+
## Download the full repository
|
|
|
|
|
|
|
| 125 |
|
| 126 |
```bash
|
| 127 |
pip install huggingface_hub
|
| 128 |
+
hf download edgeimpulse/Hey-Edge --local-dir ./Hey-Edge
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
```
|
| 130 |
|
| 131 |
+
## Download a single file
|
|
|
|
|
|
|
|
|
|
|
|
|
| 132 |
|
| 133 |
```bash
|
| 134 |
pip install huggingface_hub
|
|
|
|
|
|
|
|
|
|
| 135 |
hf download edgeimpulse/Hey-Edge CMakeLists.txt --local-dir .
|
| 136 |
```
|
| 137 |
|
| 138 |
+
## Download from Python
|
| 139 |
+
|
| 140 |
```python
|
| 141 |
from huggingface_hub import hf_hub_download, snapshot_download
|
| 142 |
+
|
| 143 |
+
path = hf_hub_download(
|
| 144 |
+
repo_id="edgeimpulse/Hey-Edge",
|
| 145 |
+
filename="CMakeLists.txt",
|
| 146 |
+
)
|
| 147 |
+
|
| 148 |
+
folder = snapshot_download(
|
| 149 |
+
repo_id="edgeimpulse/Hey-Edge",
|
| 150 |
+
)
|
| 151 |
+
```
|
| 152 |
+
|
| 153 |
+
## Build the C++ library
|
| 154 |
+
|
| 155 |
+
```bash
|
| 156 |
+
pip install huggingface_hub
|
| 157 |
+
hf download edgeimpulse/Hey-Edge --local-dir ./impulse
|
| 158 |
+
cd impulse
|
| 159 |
+
make -j
|
| 160 |
+
```
|
| 161 |
+
|
| 162 |
+
To run the standalone example with a feature file:
|
| 163 |
+
|
| 164 |
+
```bash
|
| 165 |
+
./build/edge-impulse-standalone features.txt
|
| 166 |
+
```
|
| 167 |
+
|
| 168 |
+
The repository contains the generated Edge Impulse deployment archive, including:
|
| 169 |
+
|
| 170 |
+
```text
|
| 171 |
+
edge-impulse-sdk/
|
| 172 |
+
model-parameters/
|
| 173 |
+
tflite-model/
|
| 174 |
+
```
|
| 175 |
+
|
| 176 |
+
These files can be integrated into firmware, a native application, an embedded Linux application, or another C++ project using the Edge Impulse C++ inferencing workflow.
|
| 177 |
+
|
| 178 |
+
Edge Impulse C++ deployment documentation:
|
| 179 |
+
|
| 180 |
+
https://docs.edgeimpulse.com/deploy-your-model/running-your-impulse-locally/deploy-your-impulse-as-a-c-library
|
| 181 |
+
|
| 182 |
+
## Example embedded integration
|
| 183 |
+
|
| 184 |
+
A typical embedded or native C++ application will include the generated Edge Impulse headers and call the classifier using the Edge Impulse SDK.
|
| 185 |
+
|
| 186 |
+
```cpp
|
| 187 |
+
#include "edge-impulse-sdk/classifier/ei_run_classifier.h"
|
| 188 |
+
|
| 189 |
+
static int get_signal_data(size_t offset, size_t length, float *out_ptr) {
|
| 190 |
+
return EIDSP_OK;
|
| 191 |
+
}
|
| 192 |
+
|
| 193 |
+
int main() {
|
| 194 |
+
signal_t signal;
|
| 195 |
+
signal.total_length = EI_CLASSIFIER_DSP_INPUT_FRAME_SIZE;
|
| 196 |
+
signal.get_data = &get_signal_data;
|
| 197 |
+
|
| 198 |
+
ei_impulse_result_t result = { 0 };
|
| 199 |
+
|
| 200 |
+
EI_IMPULSE_ERROR res = run_classifier(&signal, &result, false);
|
| 201 |
+
|
| 202 |
+
if (res != EI_IMPULSE_OK) {
|
| 203 |
+
return 1;
|
| 204 |
+
}
|
| 205 |
+
|
| 206 |
+
for (size_t ix = 0; ix < EI_CLASSIFIER_LABEL_COUNT; ix++) {
|
| 207 |
+
ei_printf(
|
| 208 |
+
"%s: %.5f\n",
|
| 209 |
+
result.classification[ix].label,
|
| 210 |
+
result.classification[ix].value
|
| 211 |
+
);
|
| 212 |
+
}
|
| 213 |
+
|
| 214 |
+
return 0;
|
| 215 |
+
}
|
| 216 |
```
|
| 217 |
|
| 218 |
+
For continuous microphone inference, use a rolling audio buffer, generate features at the expected sampling rate, and call the classifier on each inference window.
|
| 219 |
+
|
| 220 |
+
## Labels
|
| 221 |
+
|
| 222 |
+
| Label | Meaning |
|
| 223 |
+
|---|---|
|
| 224 |
+
| background_noise | Non-speech or background audio |
|
| 225 |
+
| hey_edge | Target wake phrase |
|
| 226 |
+
| unknown | Speech or audio that is not the target wake phrase |
|
| 227 |
+
|
| 228 |
+
A downstream application should apply a confidence threshold to hey_edge before triggering an action. The best threshold depends on the deployment environment and the acceptable false accept / false reject trade-off.
|
| 229 |
+
|
| 230 |
+
## Limitations
|
| 231 |
+
|
| 232 |
+
- Validation accuracy is based on the available validation set and may not reflect real-world performance in all acoustic environments.
|
| 233 |
+
- Synthetic and augmented data can improve coverage but may not capture all microphones, accents, rooms, background noises, or playback conditions.
|
| 234 |
+
- The hey_edge class shows some confusion with the unknown class.
|
| 235 |
+
- Real-device testing is recommended before using this model in a production wake-word pipeline.
|
| 236 |
+
- Performance depends on microphone quality, gain settings, sampling consistency, and deployment hardware.
|
| 237 |
+
|
| 238 |
+
## Recommended evaluation before deployment
|
| 239 |
+
|
| 240 |
+
Before deploying this model, test it with:
|
| 241 |
+
|
| 242 |
+
- The target microphone.
|
| 243 |
+
- Real users saying "hey edge".
|
| 244 |
+
- Background noise from the deployment environment.
|
| 245 |
+
- Similar but incorrect phrases.
|
| 246 |
+
- Different distances from the microphone.
|
| 247 |
+
- Continuous audio streams rather than isolated clips.
|
| 248 |
+
- The exact embedded hardware and compiler configuration intended for deployment.
|
| 249 |
+
|
| 250 |
+
Recommended application-level checks:
|
| 251 |
+
|
| 252 |
+
- Tune the hey_edge confidence threshold.
|
| 253 |
+
- Add debounce logic to avoid repeated triggers.
|
| 254 |
+
- Require multiple consecutive positive windows for higher precision.
|
| 255 |
+
- Log false accepts and false rejects during field testing.
|
| 256 |
+
- Retrain with real deployment audio where possible.
|
| 257 |
+
|
| 258 |
+
## About Edge Impulse
|
| 259 |
+
|
| 260 |
+
This model was exported from Edge Impulse and published to the Hugging Face Hub.
|
| 261 |
+
|
| 262 |
+
Edge Impulse handles:
|
| 263 |
+
|
| 264 |
+
- Data collection
|
| 265 |
+
- Audio preprocessing
|
| 266 |
+
- DSP feature extraction
|
| 267 |
+
- Model training
|
| 268 |
+
- Validation
|
| 269 |
+
- Deployment packaging
|
| 270 |
+
|
| 271 |
+
This repository packages the resulting C++ deployment artifact with instructions for downloading, building, and integrating the model.
|
| 272 |
+
|
| 273 |
+
Useful Edge Impulse documentation:
|
| 274 |
|
| 275 |
+
- https://docs.edgeimpulse.com/deploy-your-model
|
| 276 |
+
- https://docs.edgeimpulse.com/deploy-your-model/running-your-impulse-locally
|
| 277 |
+
- https://docs.edgeimpulse.com/deploy-your-model/running-your-impulse-locally/deploy-your-impulse-as-a-c-library
|
| 278 |
|
| 279 |
+
## Citation
|
|
|
|
|
|
|
|
|
|
| 280 |
|
| 281 |
+
```bibtex
|
| 282 |
+
@misc{heyedge_edgeimpulse,
|
| 283 |
+
title = {Hey-Edge Wake Word Model},
|
| 284 |
+
author = {Eoin Jordan - Edge Impulse},
|
| 285 |
+
year = {2026},
|
| 286 |
+
howpublished = {https://huggingface.co/edgeimpulse/Hey-Edge},
|
| 287 |
+
note = {Edge Impulse C++ library export for audio keyword spotting}
|
| 288 |
+
}
|
| 289 |
+
```
|