README.md
7.7 KB · 200 lines · markdown Raw
1 ---
2 language:
3 - en
4 thumbnail:
5 tags:
6 - audio-classification
7 - speechbrain
8 - embeddings
9 - Accent
10 - Identification
11 - pytorch
12 - ECAPA-TDNN
13 - TDNN
14 - CommonAccent
15 license: "mit"
16 datasets:
17 - CommonVoice
18 metrics:
19 - Accuracy
20 widget:
21 - example_title: Africa-English
22 src: https://huggingface.co/Jzuluaga/accent-id-commonaccent_ecapa/resolve/main/data/african_1.wav
23 - example_title: Australia-English
24 src: https://huggingface.co/Jzuluaga/accent-id-commonaccent_ecapa/resolve/main/data/australia_1.wav
25 - example_title: India-English
26 src: https://huggingface.co/Jzuluaga/accent-id-commonaccent_ecapa/resolve/main/data/indian_1.wav
27 - example_title: Ireland-English
28 src: https://huggingface.co/Jzuluaga/accent-id-commonaccent_ecapa/resolve/main/data/ireland_1.wav
29 - example_title: Malaysia-English
30 src: https://huggingface.co/Jzuluaga/accent-id-commonaccent_ecapa/resolve/main/data/malaysia_1.wav
31 - example_title: Canada-English
32 src: https://huggingface.co/Jzuluaga/accent-id-commonaccent_ecapa/resolve/main/data/canada_1.wav
33 - example_title: SouthAtlantic-English
34 src: https://huggingface.co/Jzuluaga/accent-id-commonaccent_ecapa/resolve/main/data/southatlantic_1.wav
35 ---
36
37
38 <iframe src="https://ghbtns.com/github-btn.html?user=speechbrain&repo=speechbrain&type=star&count=true&size=large&v=2" frameborder="0" scrolling="0" width="170" height="30" title="GitHub"></iframe>
39 <br/><br/>
40
41 # Accent Identification from Speech Recordings with ECAPA-TDNN embeddings on CommonAccent
42
43
44 **Abstract**: The recognition of accented speech still remains a dominant problem in Automatic Speech Recognition (ASR) systems. We approach the classification of accented English speech through the Emphasized Channel Attention, Propagation and Aggregation Time Delay Neural Network (ECAPA-TDNN) architecture which has been shown to perform well on a variety of speech tasks. Three models are proposed: one trained from scratch, another two models (one using data augmentation and a baseline model) fine-tuned from the checkpoints of speechbrain/spkrec-ecapa-voxceleb (VoxCeleb). Our results show that the model fine-tuned with data augmentation yield the best results. Most of the misclassifications were structured and expected due to accent similarities, such as the American and Canadian accents. We also explored the internal categorization of embeddings through t-SNE, a dimensionality reduction technique, and found that there was a level of clustering based on phonological similarity. For future work, we would like to explore the implementation of this accent classification system in our suggested framework to improve ASR performance by making it more inclusive to accented speech.
45
46
47 This repository provides all the necessary tools to perform accent identification from speech recordings with [SpeechBrain](https://github.com/speechbrain/speechbrain).
48 The system uses a model pretrained on the CommonAccent dataset in English (16 accents). This system is based on the CommonLanguage Recipe located here: https://github.com/speechbrain/speechbrain/tree/develop/recipes/CommonLanguage
49
50
51 The provided system can recognize the following 16 accents from short speech recordings in English (EN):
52
53 ```
54 african
55 australia
56 bermuda
57 canada
58 england
59 hongkong
60 indian
61 ireland
62 malaysia
63 newzealand
64 philippines
65 scotland
66 singapore
67 southatlandtic
68 us
69 wales
70 ```
71
72 <a href="https://github.com/JuanPZuluaga/accent-recog-slt2022"> <img alt="GitHub" src="https://img.shields.io/badge/GitHub-Open%20source-green"> </a> Github repository link: https://github.com/JuanPZuluaga/accent-recog-slt2022
73
74
75 For a better experience, we encourage you to learn more about
76 [SpeechBrain](https://speechbrain.github.io). The given model performance on the test set is:
77
78 | Release (dd/mm/yyyy) | Accuracy (%)
79 |:-------------:|:--------------:|
80 | 01-08-2023 (this model) | 87 |
81 | 01-08-2023 (this model trained without data augmentation) | 85 |
82 | 01-08-2023 (this model trained from scratch, no paremeter transfer) | 82 |
83
84
85 ## Pipeline description
86 This system is composed of an ECAPA model coupled with statistical pooling. A classifier, trained with Categorical Cross-Entropy Loss, is applied on top of that.
87
88 The system is trained with recordings sampled at 16kHz (single channel).
89 The code will automatically normalize your audio (i.e., resampling + mono channel selection) when calling *classify_file* if needed. Make sure your input tensor is compliant with the expected sampling rate if you use *encode_batch* and *classify_batch*.
90
91 ## Install SpeechBrain
92
93 First of all, please install SpeechBrain with the following command:
94
95 ```
96 pip install speechbrain
97 ```
98
99 Please notice that we encourage you to read our tutorials and learn more about
100 [SpeechBrain](https://speechbrain.github.io).
101
102 ### Perform Accent Identification from Speech Recordings
103
104 ```python
105 import torchaudio
106 from speechbrain.pretrained import EncoderClassifier
107 classifier = EncoderClassifier.from_hparams(source="Jzuluaga/accent-id-commonaccent_ecapa", savedir="pretrained_models/accent-id-commonaccent_ecapa")
108 # Irish Example
109 out_prob, score, index, text_lab = classifier.classify_file('Jzuluaga/accent-id-commonaccent_ecapa/data/ireland_1.wav')
110 print(text_lab)
111
112 # Malaysia Example
113 out_prob, score, index, text_lab = classifier.classify_file('Jzuluaga/accent-id-commonaccent_ecapa/data/malaysia_1.wav')
114 print(text_lab)
115 ```
116
117 ### Inference on GPU
118 To perform inference on the GPU, add `run_opts={"device":"cuda"}` when calling the `from_hparams` method.
119
120 ### Training
121
122 The model was trained with SpeechBrain.
123
124 To train it from scratch follow these steps:
125
126 1. Clone SpeechBrain:
127 ```bash
128 git clone https://github.com/speechbrain/speechbrain/
129 ```
130
131 2. Install it:
132 ```bash
133 cd speechbrain
134 pip install -r requirements.txt
135 pip install -e .
136 ```
137
138 3. Clone our repository in https://github.com/JuanPZuluaga/accent-recog-slt2022:
139
140 ```bash
141 git clone https://github.com/JuanPZuluaga/accent-recog-slt2022
142 cd CommonAccent/accent_id
143 python train.py hparams/train_ecapa_tdnn.yaml
144 ```
145
146 You can find our training results (models, logs, etc) in this repository's `Files and versions` page.
147
148 ### Limitations
149 The SpeechBrain team does not provide any warranty on the performance achieved by this model when used on other datasets.
150
151
152
153 #### Cite our work: CommonAccent
154
155 If you find useful this work, please cite our work as:
156
157 ```
158 @article{zuluaga2023commonaccent,
159 title={CommonAccent: Exploring Large Acoustic Pretrained Models for Accent Classification Based on Common Voice},
160 author={Zuluaga-Gomez, Juan and Ahmed, Sara and Visockas, Danielius and Subakan, Cem},
161 journal={Interspeech 2023},
162 url={https://arxiv.org/abs/2305.18283},
163 year={2023}
164 }
165 ```
166
167 #### Cite ECAPA-TDNN model
168
169 ```@inproceedings{DBLP:conf/interspeech/DesplanquesTD20,
170 author = {Brecht Desplanques and
171 Jenthe Thienpondt and
172 Kris Demuynck},
173 editor = {Helen Meng and
174 Bo Xu and
175 Thomas Fang Zheng},
176 title = {{ECAPA-TDNN:} Emphasized Channel Attention, Propagation and Aggregation
177 in {TDNN} Based Speaker Verification},
178 booktitle = {Interspeech 2020},
179 pages = {3830--3834},
180 publisher = {{ISCA}},
181 year = {2020},
182 }
183 ```
184
185
186 # **Cite SpeechBrain**
187 Please, cite SpeechBrain if you use it for your research or business.
188
189
190 ```bibtex
191 @misc{speechbrain,
192 title={{SpeechBrain}: A General-Purpose Speech Toolkit},
193 author={Mirco Ravanelli and Titouan Parcollet and Peter Plantinga and Aku Rouhe and Samuele Cornell and Loren Lugosch and Cem Subakan and Nauman Dawalatabad and Abdelwahab Heba and Jianyuan Zhong and Ju-Chieh Chou and Sung-Lin Yeh and Szu-Wei Fu and Chien-Feng Liao and Elena Rastorgueva and François Grondin and William Aris and Hwidong Na and Yan Gao and Renato De Mori and Yoshua Bengio},
194 year={2021},
195 eprint={2106.04624},
196 archivePrefix={arXiv},
197 primaryClass={eess.AS},
198 note={arXiv:2106.04624}
199 }
200 ```