yuriyvnv commited on
Commit
28689e2
·
verified ·
1 Parent(s): fe6202d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +261 -75
README.md CHANGED
@@ -1,83 +1,269 @@
1
  ---
2
- library_name: transformers
3
  license: apache-2.0
 
 
4
  base_model: openai/whisper-small
5
  tags:
6
- - generated_from_trainer
 
 
 
 
 
 
 
 
 
 
7
  model-index:
8
  - name: whisper-small-mixed-cv-nl
9
- results: []
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10
  ---
11
 
12
- <!-- This model card has been generated automatically according to the information the Trainer had access to. You
13
- should probably proofread and complete it, then remove this comment. -->
14
-
15
- # whisper-small-mixed-cv-nl
16
-
17
- This model is a fine-tuned version of [openai/whisper-small](https://huggingface.co/openai/whisper-small) on an unknown dataset.
18
- It achieves the following results on the evaluation set:
19
- - Loss: 0.1552
20
-
21
- ## Model description
22
-
23
- More information needed
24
-
25
- ## Intended uses & limitations
26
-
27
- More information needed
28
-
29
- ## Training and evaluation data
30
-
31
- More information needed
32
-
33
- ## Training procedure
34
-
35
- ### Training hyperparameters
36
-
37
- The following hyperparameters were used during training:
38
- - learning_rate: 1e-05
39
- - train_batch_size: 256
40
- - eval_batch_size: 8
41
- - seed: 42
42
- - optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
43
- - lr_scheduler_type: linear
44
- - lr_scheduler_warmup_ratio: 0.1
45
- - num_epochs: 5
46
-
47
- ### Training results
48
-
49
- | Training Loss | Epoch | Step | Validation Loss |
50
- |:-------------:|:------:|:----:|:---------------:|
51
- | 0.2429 | 0.1961 | 50 | 0.2343 |
52
- | 0.1317 | 0.3922 | 100 | 0.1946 |
53
- | 0.1159 | 0.5882 | 150 | 0.1804 |
54
- | 0.0959 | 0.7843 | 200 | 0.1690 |
55
- | 0.0927 | 0.9804 | 250 | 0.1625 |
56
- | 0.0626 | 1.1765 | 300 | 0.1591 |
57
- | 0.0623 | 1.3725 | 350 | 0.1560 |
58
- | 0.061 | 1.5686 | 400 | 0.1544 |
59
- | 0.0568 | 1.7647 | 450 | 0.1519 |
60
- | 0.0587 | 1.9608 | 500 | 0.1484 |
61
- | 0.0373 | 2.1569 | 550 | 0.1499 |
62
- | 0.0338 | 2.3529 | 600 | 0.1504 |
63
- | 0.036 | 2.5490 | 650 | 0.1502 |
64
- | 0.0368 | 2.7451 | 700 | 0.1499 |
65
- | 0.0354 | 2.9412 | 750 | 0.1484 |
66
- | 0.0253 | 3.1373 | 800 | 0.1509 |
67
- | 0.0247 | 3.3333 | 850 | 0.1515 |
68
- | 0.0234 | 3.5294 | 900 | 0.1529 |
69
- | 0.0247 | 3.7255 | 950 | 0.1516 |
70
- | 0.0237 | 3.9216 | 1000 | 0.1522 |
71
- | 0.0189 | 4.1176 | 1050 | 0.1538 |
72
- | 0.0191 | 4.3137 | 1100 | 0.1549 |
73
- | 0.0183 | 4.5098 | 1150 | 0.1549 |
74
- | 0.0194 | 4.7059 | 1200 | 0.1554 |
75
- | 0.0198 | 4.9020 | 1250 | 0.1552 |
76
-
77
-
78
- ### Framework versions
79
-
80
- - Transformers 4.50.2
81
- - Pytorch 2.5.1+cu124
82
- - Datasets 3.6.0
83
- - Tokenizers 0.21.2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
 
2
  license: apache-2.0
3
+ language:
4
+ - nl
5
  base_model: openai/whisper-small
6
  tags:
7
+ - automatic-speech-recognition
8
+ - whisper
9
+ - dutch
10
+ - speech
11
+ - audio
12
+ - synthetic-data
13
+ - asr
14
+ - hf-asr-leaderboard
15
+ datasets:
16
+ - mozilla-foundation/common_voice_17_0
17
+ - yuriyvnv/synthetic_transcript_nl
18
  model-index:
19
  - name: whisper-small-mixed-cv-nl
20
+ results:
21
+ - task:
22
+ type: automatic-speech-recognition
23
+ name: Automatic Speech Recognition
24
+ dataset:
25
+ name: Common Voice 17.0 (Dutch)
26
+ type: mozilla-foundation/common_voice_17_0
27
+ config: nl
28
+ split: test
29
+ metrics:
30
+ - type: wer
31
+ value: 10.86
32
+ name: Test WER
33
+ - task:
34
+ type: automatic-speech-recognition
35
+ name: Automatic Speech Recognition
36
+ dataset:
37
+ name: Multilingual LibriSpeech (Dutch)
38
+ type: facebook/multilingual_librispeech
39
+ config: dutch
40
+ split: test
41
+ metrics:
42
+ - type: wer
43
+ value: 30.04
44
+ name: Test WER (MLS)
45
+ pipeline_tag: automatic-speech-recognition
46
+ library_name: transformers
47
  ---
48
 
49
+ # Whisper-Small Dutch - Mixed Synthetic Data (Mid-High Quality Filtered)
50
+
51
+ This model is a fine-tuned version of [openai/whisper-small](https://huggingface.co/openai/whisper-small) for Dutch automatic speech recognition (ASR). It was trained on Common Voice 17.0 Dutch combined with **WAVe-filtered synthetic speech data** (quality threshold q ≥ 0.5).
52
+
53
+ ## Introduction
54
+
55
+ ### How the Data Was Created
56
+
57
+ The training data combines real speech from Common Voice 17.0 with synthetic speech generated through a two-stage pipeline:
58
+
59
+ 1. **Transcript Generation**: We used GPT-4o-mini to generate Dutch transcripts that match the word count distribution observed in Common Voice, ensuring realistic utterance lengths and diverse linguistic content.
60
+
61
+ 2. **Speech Synthesis**: Each transcript was converted to audio using OpenAI's TTS-1 model with 9 different voice variants (alloy, ash, coral, echo, fable, nova, onyx, sage, shimmer), producing 34,898 synthetic samples.
62
+
63
+ 3. **Quality Filtering with WAVe**: Raw synthetic speech often contains defects such as mispronunciations, omitted words, or prosodic anomalies. To address this, we applied **WAVe (Word-Aligned Verification)**, a model that assesses audio-text alignment at the word level rather than the sentence level. WAVe uses multi-head attention to align each word to its corresponding audio frames and assigns per-word confidence scores via a GLU-based scorer. Samples scoring below the threshold (q < 0.5) were removed, retaining 30,182 high-quality synthetic samples.
64
+
65
+ ### How the Model Was Created
66
+
67
+ The model was fine-tuned from `openai/whisper-small` using the Hugging Face Transformers library with the following approach:
68
+
69
+ 1. **Mixed Training**: Combined 34,952 real speech samples from Common Voice 17.0 Dutch with 30,182 WAVe-filtered synthetic samples (65,134 total).
70
+
71
+ 2. **Optimization**: Trained for 5 epochs with a learning rate of 1e-5, global batch size of 256, and BF16 precision on an NVIDIA H200 GPU.
72
+
73
+ 3. **Checkpoint Selection**: The best checkpoint was selected based on validation loss, occurring at step 500 with a validation loss of 0.1484.
74
+
75
+ This approach achieves the **best Test WER (10.86%)** among all Whisper-Small Dutch configurations while maintaining strong cross-domain generalization.
76
+
77
+ ## Model Details
78
+
79
+ | Property | Value |
80
+ |----------|-------|
81
+ | **Base Model** | openai/whisper-small |
82
+ | **Language** | Dutch (nl) |
83
+ | **Task** | Automatic Speech Recognition (transcribe) |
84
+ | **Parameters** | 244M |
85
+ | **Training Data** | Common Voice 17.0 + Mid-High Quality Synthetic (q ≥ 0.5) |
86
+ | **Total Training Samples** | 65,134 |
87
+ | **Sampling Rate** | 16kHz |
88
+
89
+ ## Evaluation Results
90
+
91
+ ### This Model (whisper-small-mixed-cv-nl)
92
+
93
+ | Metric | Value |
94
+ |--------|-------|
95
+ | **Validation Loss** | 0.1484 |
96
+ | **Validation WER** | 8.73% |
97
+ | **Test WER (Common Voice)** | 10.86% |
98
+ | **Test WER (MLS)** | 30.04% |
99
+ | **Best Checkpoint** | Step 500 |
100
+ | **Max Training Steps** | 1,270 |
101
+
102
+ ### Comparison with Other Training Configurations (Whisper-Small Dutch)
103
+
104
+ | Training Data | Max Steps | Val Loss | Val WER | Test WER (CV) | Test WER (MLS) |
105
+ |---------------|-----------|----------|---------|---------------|----------------|
106
+ | Common Voice Only | 680 | 0.1491 | 8.73% | 11.13% | 30.71% |
107
+ | High-Quality Filtered + CV | 890 | 0.1493 | 8.76% | 11.00% | 29.91% |
108
+ | **Mid-High Quality Filtered + CV** | **1,270** | **0.1484** | **8.73%** | **10.86%** | **30.04%** |
109
+ | All Synthetic + CV (Unfiltered) | 1,365 | 0.1484 | 8.64% | 10.91% | 30.06% |
110
+
111
+ ### Key Performance Highlights
112
+
113
+ - **Best Test WER** (10.86%) on Common Voice among all Whisper-Small Dutch configurations
114
+ - **2.4% relative improvement** on Common Voice test set vs baseline (10.86% vs 11.13%)
115
+ - **2.2% relative improvement** on MLS benchmark vs baseline (30.04% vs 30.71%)
116
+ - **7% fewer training steps** than unfiltered synthetic data while achieving better in-domain performance
117
+
118
+ ## Training Data
119
+
120
+ ### Dataset Composition
121
+
122
+ | Source | Samples | Description |
123
+ |--------|---------|-------------|
124
+ | [Common Voice 17.0 Dutch](https://huggingface.co/datasets/mozilla-foundation/common_voice_17_0) | 34,952 | Real speech from Mozilla's crowdsourced dataset |
125
+ | [Synthetic Transcript NL](https://huggingface.co/datasets/yuriyvnv/synthetic_transcript_nl) (q ≥ 0.5) | 30,182 | WAVe-filtered TTS audio from GPT-4o-mini transcripts |
126
+ | **Total** | **65,134** | |
127
+
128
+ ### Synthetic Data Generation Pipeline
129
+
130
+ The synthetic dataset ([yuriyvnv/synthetic_transcript_nl](https://huggingface.co/datasets/yuriyvnv/synthetic_transcript_nl)) was generated using:
131
+
132
+ 1. **Transcript Generation**: GPT-4o-mini, matching Common Voice word count distribution
133
+ 2. **Speech Synthesis**: OpenAI TTS-1 model with 9 voice variants (alloy, ash, coral, echo, fable, nova, onyx, sage, shimmer)
134
+ 3. **Quality Filtering**: WAVe model filtering at threshold q ≥ 0.5
135
+
136
+ ### WAVe Quality Distribution (Dutch Synthetic Data)
137
+
138
+ | Quality Level | Samples | Percentage | Used in This Model |
139
+ |--------------|---------|------------|-------------------|
140
+ | High (q ≥ 0.8) | 10,555 | 30.2% | ✓ |
141
+ | Medium (0.5 ≤ q < 0.8) | 19,627 | 56.2% | ✓ |
142
+ | Low (q < 0.5) | 4,716 | 13.5% | ✗ |
143
+
144
+ ## Training Procedure
145
+
146
+ ### Hyperparameters
147
+
148
+ | Parameter | Value |
149
+ |-----------|-------|
150
+ | Learning Rate | 1e-5 |
151
+ | Batch Size (Global) | 256 |
152
+ | Warmup Steps | 200 |
153
+ | Max Epochs | 5 |
154
+ | Precision | BF16 |
155
+ | Optimizer | AdamW (fused) |
156
+ | Eval Steps | 50 |
157
+ | Metric for Best Model | eval_loss |
158
+
159
+ ### Training Infrastructure
160
+
161
+ - **GPU**: NVIDIA H200 (140GB VRAM)
162
+ - **Operating System**: Ubuntu 22.04
163
+ - **Framework**: Hugging Face Transformers
164
+
165
+ ### Training Curve
166
+
167
+ ```
168
+ Step 100: val_loss = 0.1946
169
+ Step 250: val_loss = 0.1625
170
+ Step 400: val_loss = 0.1544
171
+ Step 500: val_loss = 0.1484 ← Best checkpoint
172
+ Step 750: val_loss = 0.1484
173
+ Step 1000: val_loss = 0.1522
174
+ Step 1250: val_loss = 0.1552
175
+ ```
176
+
177
+ ## Usage
178
+
179
+ ### Transcription Pipeline
180
+
181
+ ```python
182
+ from transformers import pipeline
183
+
184
+ transcriber = pipeline(
185
+ "automatic-speech-recognition",
186
+ model="yuriyvnv/whisper-small-mixed-cv-nl",
187
+ device="cuda"
188
+ )
189
+
190
+ result = transcriber("path/to/dutch_audio.wav")
191
+ print(result["text"])
192
+ ```
193
+
194
+ ### Direct Model Usage
195
+
196
+ ```python
197
+ from transformers import WhisperProcessor, WhisperForConditionalGeneration
198
+ import librosa
199
+
200
+ processor = WhisperProcessor.from_pretrained("yuriyvnv/whisper-small-mixed-cv-nl")
201
+ model = WhisperForConditionalGeneration.from_pretrained("yuriyvnv/whisper-small-mixed-cv-nl")
202
+ model.to("cuda")
203
+
204
+ audio, sr = librosa.load("path/to/dutch_audio.wav", sr=16000)
205
+ input_features = processor(audio, sampling_rate=16000, return_tensors="pt").input_features.to("cuda")
206
+
207
+ predicted_ids = model.generate(input_features)
208
+ transcription = processor.batch_decode(predicted_ids, skip_special_tokens=True)[0]
209
+ print(transcription)
210
+ ```
211
+
212
+ ### Specifying Language
213
+
214
+ ```python
215
+ model.generation_config.language = "nl"
216
+ model.generation_config.task = "transcribe"
217
+ ```
218
+
219
+ ## Methodology
220
+
221
+ This model leverages **WAVe (Word-Aligned Verification)**, a word-level quality assessment method for filtering synthetic speech data. Unlike sentence-level filtering approaches, WAVe:
222
+
223
+ - Aligns each word to its corresponding audio frames using multi-head attention
224
+ - Assigns per-word confidence scores via a GLU-based scorer
225
+ - Detects localized synthesis errors (mispronunciations, omitted words, prosodic anomalies)
226
+ - Achieves **6.5% improvement** over sentence-level filtering methods
227
+
228
+ For full methodology details, see the references below.
229
+
230
+ ## When to Use This Model
231
+
232
+ This model is ideal when:
233
+ - **Best in-domain accuracy is required**: Achieves 10.86% Test WER (best among Small Dutch models)
234
+ - **Balanced performance**: Good tradeoff between in-domain and cross-domain generalization
235
+ - **Moderate compute budget**: 7% fewer steps than unfiltered approach
236
+
237
+ Consider alternatives based on your needs:
238
+ - [whisper-small-high-mixed-nl](https://huggingface.co/yuriyvnv/whisper-small-high-mixed-nl): 35% fewer steps, slight accuracy tradeoff
239
+ - [whisper-small-cv-fully-synthetic-nl](https://huggingface.co/yuriyvnv/whisper-small-cv-fully-synthetic-nl): Maximum data, similar performance
240
+
241
+ ## Limitations
242
+
243
+ - **Domain specificity**: Optimized for general Dutch; may underperform on technical domains
244
+ - **Acoustic conditions**: Trained on clean speech; noise robustness not guaranteed
245
+ - **Dialect coverage**: Performance may vary across Dutch regional variants
246
+
247
+ ## Citation
248
+
249
+ ```bibtex
250
+ @article{perezhohin2024enhancing,
251
+ title={Enhancing Automatic Speech Recognition: Effects of Semantic Audio Filtering on Models Performance},
252
+ author={Perezhohin, Yuriy and Santos, Tiago and Costa, Victor and Peres, Fernando and Castelli, Mauro},
253
+ journal={IEEE Access},
254
+ year={2024},
255
+ publisher={IEEE}
256
+ }
257
+ ```
258
+
259
+ ## References
260
+
261
+ - **Base Model**: [openai/whisper-small](https://huggingface.co/openai/whisper-small)
262
+ - **Training Data (Real)**: [mozilla-foundation/common_voice_17_0](https://huggingface.co/datasets/mozilla-foundation/common_voice_17_0)
263
+ - **Training Data (Synthetic)**: [yuriyvnv/synthetic_transcript_nl](https://huggingface.co/datasets/yuriyvnv/synthetic_transcript_nl)
264
+ - **Whisper Paper**: [Robust Speech Recognition via Large-Scale Weak Supervision](https://arxiv.org/abs/2212.04356)
265
+ - **IEEE Access Paper**: [Enhancing ASR with Semantic Audio Filtering](https://ieeexplore.ieee.org/document/10720758)
266
+
267
+ ## License
268
+
269
+ Apache 2.0