atulyaatul commited on
Commit
6de8343
Β·
verified Β·
1 Parent(s): 7cf2812

Add Hush Model Card

Browse files
Files changed (1) hide show
  1. README.md +259 -0
README.md ADDED
@@ -0,0 +1,259 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: apache-2.0
3
+ language: multilingual
4
+ tags:
5
+ - speech-enhancement
6
+ - denoising
7
+ - real-time
8
+ - voice-ai
9
+ - hush
10
+ - background-speaker-suppression
11
+ - onnx
12
+ - multilingual
13
+ - audio
14
+ - noise-cancellation
15
+ library_name: hush
16
+ pipeline_tag: audio-to-audio
17
+ ---
18
+
19
+ # Hush
20
+
21
+ **The first open-source speech enhancement model built specifically for Voice AI β€” with real-time background speaker suppression.**
22
+
23
+ > **8 MB model Β· Runs fully on CPU in real time Β· Trained on 10,000+ hours of mixed audio Β· Under 1 ms processing per 10 ms of audio**
24
+
25
+ [![GitHub](https://img.shields.io/badge/GitHub-Repository-blue?logo=github)](https://github.com/pulp-vision/Hush)
26
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
27
+ [![Python](https://img.shields.io/badge/python-3.9%2B-blue.svg)](https://python.org)
28
+ [![PyTorch](https://img.shields.io/badge/PyTorch-2.0%2B-orange.svg)](https://pytorch.org)
29
+
30
+ ---
31
+
32
+ ## Model Overview
33
+
34
+ Hush is designed from the ground up for **Voice AI applications** β€” phone-based voice agents, call centre bots, voice assistants, real-time transcription pipelines, and conversational AI systems. It isolates exactly one speaker from a live audio stream, in real time, under production conditions.
35
+
36
+ The model is **language-agnostic** β€” it operates on the acoustic signal directly and works for any spoken language.
37
+
38
+ ### At a Production Glance
39
+
40
+ | | |
41
+ |---|---|
42
+ | Model size | **8 MB** |
43
+ | Runs on | **CPU only β€” no GPU required** |
44
+ | Processing latency | **< 1 ms per 10 ms of audio** |
45
+ | Algorithmic latency | ~20 ms (fully causal, zero lookahead) |
46
+ | Training data | **10,000+ hours** of mixed speech, noise, and competing speakers |
47
+ | Sample rate | 16 kHz (telephony-native: G.711, WebRTC, SIP) |
48
+ | Language | **Any** (language-agnostic speech enhancement) |
49
+
50
+ ---
51
+
52
+ ## The Problem It Solves
53
+
54
+ Every major open-source speech enhancement model (DeepFilterNet3, RNNoise, SEGAN, MetricGAN+, DNS-Challenge entrants) is trained on **stationary noise** β€” fans, traffic, keyboard clicks. None treat a competing human voice as a first-class problem.
55
+
56
+ When the interference is another person speaking, these models either:
57
+ - **Leak the competing speaker** β†’ gets transcribed as part of the conversation, breaking NLP/LLMs
58
+ - **Suppress both speakers** β†’ degrades the primary speaker's intelligibility
59
+
60
+ **Hush is the first open-source model to explicitly train for background speaker suppression.**
61
+
62
+ ---
63
+
64
+ ## What Makes Hush Different
65
+
66
+ Built on [DeepFilterNet3](https://github.com/Rikorose/DeepFilterNet), extended with one targeted innovation: **teaching the encoder to distinguish speakers, not just speech from noise.**
67
+
68
+ 1. **Training data reflecting the real problem** β€” 60% of training samples include a competing human speaker at 12–24 dB SIR
69
+ 2. **Auxiliary Separation Head** β€” lightweight `Linear(256β†’32) + Sigmoid` head trained with L1 loss to predict ERB-domain background speaker masks (training only β€” zero inference overhead)
70
+ 3. **Joint optimization** β€” separation loss (weight 0.1) combined with multi-resolution spectral loss across 4 FFT scales
71
+
72
+ ---
73
+
74
+ ## Architecture
75
+
76
+ ```
77
+ Input Waveform [B, 1, T]
78
+ |
79
+ v
80
+ STFT (FFT=320, Hop=160)
81
+ |
82
+ _____|_______________
83
+ | |
84
+ v v
85
+ ERB features DF features
86
+ [B, 1, T, 32] [B, 2, T, 64]
87
+ | |
88
+ '-------+------------'
89
+ |
90
+ v
91
+ ENCODER
92
+ (SqueezedGRU, 256-dim)
93
+ |
94
+ ________|____________________________
95
+ | | |
96
+ v v v
97
+ ERB DECODER DF DECODER SEPARATION HEAD *
98
+ (ConvTranspose (3-layer GRU (Linear + Sigmoid
99
+ + skip conns) + DF filter) ERB-domain mask)
100
+ | |
101
+ v v
102
+ ERB gain mask Complex filter
103
+ | |
104
+ '-------+--------'
105
+ |
106
+ v
107
+ Enhanced Spectrum
108
+ |
109
+ v
110
+ ISTFT
111
+ |
112
+ v
113
+ Enhanced Waveform [B, 1, T]
114
+ ```
115
+
116
+ `*` Separation Head is active during training only β€” discarded at inference.
117
+
118
+ ### Model Specifications
119
+
120
+ | Parameter | Value |
121
+ |---|---|
122
+ | Model size | **8 MB** |
123
+ | Parameters | ~1.8M |
124
+ | Sample rate | 16,000 Hz |
125
+ | Frame size / hop | 320 / 160 samples (10 ms) |
126
+ | ERB bands | 32 |
127
+ | DF bins | 64 (order-5 filter) |
128
+ | Encoder dim | 256 |
129
+ | Lookahead | 0 (fully causal) |
130
+
131
+ ---
132
+
133
+ ## Quick Start: PyTorch Inference
134
+
135
+ ```python
136
+ import torch
137
+ import soundfile as sf
138
+ from model.dfnet_se import DfNetSE, get_config
139
+
140
+ config = get_config()
141
+ model = DfNetSE(config)
142
+ checkpoint = torch.load("model_best.ckpt", map_location="cpu")
143
+ model.model.load_state_dict(checkpoint)
144
+ model.eval()
145
+
146
+ audio, sr = sf.read("noisy_speech.wav")
147
+ assert sr == 16000, "Input must be 16 kHz"
148
+
149
+ wav = torch.tensor(audio).float().unsqueeze(0).unsqueeze(0) # [1, 1, T]
150
+ with torch.no_grad():
151
+ enhanced = model(wav) # [1, 1, T]
152
+
153
+ sf.write("enhanced.wav", enhanced.squeeze().numpy(), 16000)
154
+ ```
155
+
156
+ ## Quick Start: Production (ONNX, No PyTorch)
157
+
158
+ For production deployment without PyTorch, use the prebuilt **Weya NC Standalone** library:
159
+
160
+ ```python
161
+ import ctypes, platform, numpy as np
162
+
163
+ lib_name = {"Darwin": "libweya_nc.dylib", "Windows": "weya_nc.dll"}.get(
164
+ platform.system(), "libweya_nc.so"
165
+ )
166
+ lib = ctypes.CDLL(f"deployment/lib/{lib_name}")
167
+
168
+ model = lib.weya_nc_model_load_from_path(b"onnx/advanced_dfnet16k_model_best_onnx.tar.gz")
169
+ session = lib.weya_nc_session_create(model, 16000, ctypes.c_float(100.0))
170
+ frame_len = int(lib.weya_nc_get_frame_length(session))
171
+ lib.weya_nc_process_frame(session, input_ptr, output_ptr)
172
+ ```
173
+
174
+ Prebuilt binaries are available for Linux, macOS (Apple Silicon), and Windows. See the [deployment guide](https://github.com/pulp-vision/Hush/tree/main/deployment) for full integration instructions.
175
+
176
+ ---
177
+
178
+ ## Training Details
179
+
180
+ | Hyperparameter | Value |
181
+ |---|---|
182
+ | Optimizer | AdamW |
183
+ | Learning rate | 5e-4 (cosine decay to 1e-6) |
184
+ | LR warmup | 3 epochs (1e-4 β†’ 5e-4) |
185
+ | Weight decay | 0.05 |
186
+ | Batch size | 16 |
187
+ | Max sample length | 5 seconds |
188
+ | Epochs | 100 |
189
+ | Early stopping | patience=25 epochs |
190
+ | Gradient clip | 1.0 |
191
+ | Loss | MultiResSpecLoss (4 scales) + LocalSNRLoss + SeparationLoss (Γ—0.1) |
192
+ | Background speaker prob. | 60% of samples |
193
+ | Background SIR range | 12–24 dB |
194
+
195
+ ---
196
+
197
+ ## Datasets Used
198
+
199
+ The model was trained on standard publicly available datasets totalling **over 10,000 hours of mixed audio**:
200
+
201
+ | Category | Datasets |
202
+ |---|---|
203
+ | **Primary speech** | LibriSpeech (train-clean-100/360), VCTK Corpus, Common Voice (English) |
204
+ | **Background speech** | LibriSpeech / VCTK / LibriTTS (speaker-disjoint splits) |
205
+ | **Noise** | DNS Challenge, FreeSound, ESC-50, AudioSet |
206
+ | **Room impulse responses** | MIT IR Survey, OpenAIR, BUT ReverbDB |
207
+
208
+ See [DATASETS.md](https://github.com/pulp-vision/Hush/blob/main/DATASETS.md) for full details with URLs and licensing.
209
+
210
+ ---
211
+
212
+ ## Known Limitations
213
+
214
+ - **16 kHz only** β€” trained and evaluated at 16 kHz; other sample rates require resampling
215
+ - **Separation head is auxiliary** β€” the background speaker mask is an ERB-domain soft mask used for training regularization, not a standalone source separation output
216
+ - **Background speakers at moderate SIR** β€” trained with background speakers at 12–24 dB SIR; very loud competing speakers may not be fully suppressed
217
+
218
+ ---
219
+
220
+ ## Repository Structure
221
+
222
+ ```
223
+ weya-ai/hush/ (this Hugging Face repo)
224
+ β”œβ”€β”€ README.md ← This Model Card
225
+ β”œβ”€β”€ config.json ← Model configuration metadata
226
+ β”œβ”€β”€ model_best.ckpt ← PyTorch checkpoint
227
+ β”œβ”€β”€ onnx/
228
+ β”‚ └── advanced_dfnet16k_model_best_onnx.tar.gz ← ONNX production bundle
229
+ └── LICENSE ← Apache 2.0
230
+ ```
231
+
232
+ Full source code, training scripts, deployment examples, and documentation are available on [**GitHub**](https://github.com/pulp-vision/Hush).
233
+
234
+ ---
235
+
236
+ ## Acknowledgements
237
+
238
+ Built on [DeepFilterNet](https://github.com/Rikorose/DeepFilterNet) by Hendrik SchrΓΆter, Tobias Rosenkranz, Alberto N. Escalante-B., and Andreas Maier. The core architecture, ERB filterbank, SqueezedGRU module, and loss functions closely follow the DF3 design.
239
+
240
+ ---
241
+
242
+ ## Citation
243
+
244
+ If you use this model or code, please cite the original DeepFilterNet paper:
245
+
246
+ ```bibtex
247
+ @inproceedings{schroter2023deepfilternet3,
248
+ title = {DeepFilterNet: Perceptually Motivated Real-Time Speech Enhancement},
249
+ author = {SchrΓΆter, Hendrik and Rosenkranz, Tobias and Escalante-B., Alberto N and Maier, Andreas},
250
+ booktitle = {INTERSPEECH},
251
+ year = {2023}
252
+ }
253
+ ```
254
+
255
+ ---
256
+
257
+ ## License
258
+
259
+ Apache License 2.0 β€” see [LICENSE](LICENSE) for details.