readme: ---
  language:
  - en
  thumbnail:
  tags:
  - audio-classification
  - speechbrain
  - embeddings
  - Accent
  - Identification
  - pytorch
  - ECAPA-TDNN
  - TDNN
  - CommonAccent
  license: "mit"
  datasets:
  - CommonVoice
  metrics:
  - Accuracy
  widget:
  - example_title: Africa-English
    src: https://huggingface.co/Jzuluaga/accent-id-commonaccent_ecapa/resolve/main/data/african_1.wav
  - example_title: Australia-English
    src: https://huggingface.co/Jzuluaga/accent-id-commonaccent_ecapa/resolve/main/data/australia_1.wav
  - example_title: India-English
    src: https://huggingface.co/Jzuluaga/accent-id-commonaccent_ecapa/resolve/main/data/indian_1.wav
  - example_title: Ireland-English
    src: https://huggingface.co/Jzuluaga/accent-id-commonaccent_ecapa/resolve/main/data/ireland_1.wav
  - example_title: Malaysia-English
    src: https://huggingface.co/Jzuluaga/accent-id-commonaccent_ecapa/resolve/main/data/malaysia_1.wav
  - example_title: Canada-English
    src: https://huggingface.co/Jzuluaga/accent-id-commonaccent_ecapa/resolve/main/data/canada_1.wav
  - example_title: SouthAtlantic-English
    src: https://huggingface.co/Jzuluaga/accent-id-commonaccent_ecapa/resolve/main/data/southatlantic_1.wav
  ---
  
  
  <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>
  <br/><br/>
  
  # Accent Identification from Speech Recordings with ECAPA-TDNN embeddings on CommonAccent
  
  
  **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. 
  
  
  This repository provides all the necessary tools to perform accent identification from speech recordings with [SpeechBrain](https://github.com/speechbrain/speechbrain).
  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
  
  
  The provided system can recognize the following 16 accents from short speech recordings in English (EN):
  
  ```
  african
  australia
  bermuda
  canada
  england
  hongkong
  indian
  ireland
  malaysia
  newzealand
  philippines
  scotland
  singapore
  southatlandtic
  us
  wales
  ```
  
  <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
  
  
  For a better experience, we encourage you to learn more about
  [SpeechBrain](https://speechbrain.github.io). The given model performance on the test set is:
  
  | Release (dd/mm/yyyy) | Accuracy (%)
  |:-------------:|:--------------:|
  | 01-08-2023 (this model) | 87 | 
  | 01-08-2023 (this model trained without data augmentation) | 85 | 
  | 01-08-2023 (this model trained from scratch, no paremeter transfer) | 82 | 
  
  
  ## Pipeline description
  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.
  
  The system is trained with recordings sampled at 16kHz (single channel).
  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*.
  
  ## Install SpeechBrain
  
  First of all, please install SpeechBrain with the following command:
  
  ```
  pip install speechbrain
  ```
  
  Please notice that we encourage you to read our tutorials and learn more about
  [SpeechBrain](https://speechbrain.github.io).
  
  ### Perform Accent Identification from Speech Recordings
  
  ```python
  import torchaudio
  from speechbrain.pretrained import EncoderClassifier
  classifier = EncoderClassifier.from_hparams(source="Jzuluaga/accent-id-commonaccent_ecapa", savedir="pretrained_models/acce