readme: ---
  language: zh-HK
  license: apache-2.0
  tags:
  - automatic-speech-recognition
  - generated_from_trainer
  - hf-asr-leaderboard
  - robust-speech-event
  datasets:
  - common_voice
  model-index:
  - name: Wav2Vec2 XLS-R 300M Cantonese (zh-HK)
    results:
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Common Voice
        type: common_voice
        args: zh-HK
      metrics:
      - name: Test CER
        type: cer
        value: 31.73
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Common Voice 7
        type: mozilla-foundation/common_voice_7_0
        args: zh-HK
      metrics:
      - name: Test CER
        type: cer
        value: 23.11
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Common Voice 8
        type: mozilla-foundation/common_voice_8_0
        args: zh-HK
      metrics:
      - name: Test CER
        type: cer
        value: 23.02
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Robust Speech Event - Dev Data
        type: speech-recognition-community-v2/dev_data
        args: zh-HK
      metrics:
      - name: Test CER
        type: cer
        value: 56.6
    - task:
        name: Automatic Speech Recognition
        type: automatic-speech-recognition
      dataset:
        name: Robust Speech Event - Test Data
        type: speech-recognition-community-v2/eval_data
        args: zh-HK
      metrics:
      - name: Test CER
        type: cer
        value: 55.11
  ---
  
  # Wav2Vec2 XLS-R 300M Cantonese (zh-HK)
  
  Wav2Vec2 XLS-R 300M Cantonese (zh-HK) is an automatic speech recognition model based on the [XLS-R](https://arxiv.org/abs/2111.09296) architecture. This model is a fine-tuned version of [Wav2Vec2-XLS-R-300M](https://huggingface.co/facebook/wav2vec2-xls-r-300m) on the `zh-HK` subset of the [Common Voice](https://huggingface.co/datasets/common_voice) dataset.
  
  This model was trained using HuggingFace's PyTorch framework and is part of the [Robust Speech Challenge Event](https://discuss.huggingface.co/t/open-to-the-community-robust-speech-recognition-challenge/13614) organized by HuggingFace. All training was done on a Tesla V100, sponsored by OVH.
  
  All necessary scripts used for training could be found in the [Files and versions](https://huggingface.co/w11wo/wav2vec2-xls-r-300m-zh-HK-v2/tree/main) tab, as well as the [Training metrics](https://huggingface.co/w11wo/wav2vec2-xls-r-300m-zh-HK-v2/tensorboard) logged via Tensorboard.
  
  ## Model
  
  | Model                          | #params | Arch. | Training/Validation data (text) |
  | ------------------------------ | ------- | ----- | ------------------------------- |
  | `wav2vec2-xls-r-300m-zh-HK-v2` | 300M    | XLS-R | `Common Voice zh-HK` Dataset    |
  
  ## Evaluation Results
  
  The model achieves the following results on evaluation:
  
  | Dataset                          | Loss   | CER    |
  | -------------------------------- | ------ | ------ |
  | `Common Voice`                   | 0.8089 | 31.73% |
  | `Common Voice 7`                 | N/A    | 23.11% |
  | `Common Voice 8`                 | N/A    | 23.02% |
  | `Robust Speech Event - Dev Data` | N/A    | 56.60% |
  
  ## Training procedure
  
  ### Training hyperparameters
  
  The following hyperparameters were used during training:
  
  - `learning_rate`: 0.0001
  - `train_batch_size`: 8
  - `eval_batch_size`: 8
  - `seed`: 42
  - `gradient_accumulation_steps`: 4
  - `total_train_batch_size`: 32
  - `optimizer`: Adam with `betas=(0.9, 0.999)` and `epsilon=1e-08`
  - `lr_scheduler_type`: linear
  - `lr_scheduler_warmup_steps`: 2000
  - `num_epochs`: 100.0
  - `mixed_precision_training`: Native AMP
  
  ### Training results
  
  | Training Loss | Epoch | Step  | Validation Loss |  Wer   |  Cer   |
  | :-----------: | :---: | :---: | :-------------: | :----: | :----: |
  |    69.8341    | 1.34  |  500  |     80.0722     |  1.0   |  1.0   |
  |    6.6418     | 2.68  | 1000  |     6.6346      |  1.0   |  1.0   |
  |    6.2419     | 4.02  | 1500  |     6.2909      |  1.0   |  1.0   |
  |    6.0813     | 5.36  | 2000  |     6.1150      |  1.0   |  1.0   |
  |    5.9677     |  6.7  | 2500  |     6.0301      | 1.1386 | 1.0028 |
  |    5.9296     | 8.04  | 3000  |     5.8975      | 1.2113 | 1.0058 |
  |    5.6434     | 9.38  | 3500  |     5.5404      | 2.1624 | 1.0171 |
  |    5.1974     | 10.72 | 4000  |     4.5440      | 2.1702 | 0.9366 |
  |    4.3601     | 12.06 | 4500  |     3.3839      | 2.2464 | 0.8998 |
  |    3.9321     | 13.4  | 5000  |     2.8785      | 2.3097 | 0.8400 |
  |    3.6462     | 14.74 | 5500  |     2.5108      | 1.9623 | 0.6663 |
  |    3.5156     | 16.09 | 6000  |     2.2790      | 1.6479 | 0.5706 |
  |     3.32      | 17.43 | 6500  |     2.1450      | 1.8337 | 0.6244 |
  |    3.1918     | 18.77 | 7000  |     1.8536      | 1.9394 | 0.6017 |
  |    3.1139     | 20.11 | 7500  |     1.7205      | 1.9112 | 0.5638 |
  |    2.8995     | 21.45 | 8000  |     1.5478      | 1.0624 | 0.32