The MERaLiON-SpeechEncoder is a speech foundation model designed to support a wide range of downstream speech applications, like speech recognition, intent classification and speaker identification, among others. This version was trained on
200,000 hours of predominantly English data including 10,000 hours of Singapore-based speech
, to cater to the speech processing needs in Singapore and beyond. Gradual support for other languages, starting with major Southeast Asian ones are planned for subsequent releases.
Developed by:
I
2
R, A*STAR
Model type:
Speech Encoder
Language(s):
Primarily English (Global & Singapore)
For details on background, pre-training, tuning experiments and evaluation, please refer to our
technical report
.
Acknowledgement
This research is supported by the National Research Foundation, Singapore and Infocomm Media Development Authority, Singapore under its National Large Language Models Funding Initiative.
Model Description
MERaLiON-SpeechEncoder was pre-trained from scratch with a self-supervised learning approach using a
BERT-based speech pre-training with random-projection quantizer (BEST-RQ)
objective. Analogous to BERT's mask language modelling criterion for text, this entails predicting the correct discrete label from a codebook, over the masked frames of an input speech signal. MERaLiON-SpeechEncoder-v1 contains approximately 630M parameters.
The model takes in speech as input in the form of mel-spectrograms and returns compressed latent features which can then be passed to a task-specific downstream model, relevant to the user's application. Note that the model provided here is the base foundation model itself and the user has to fine-tune the model with task-specific data for a complete inference pipeline. We provide some examples below to get one started.
Capabilities
We have evaluated the MERaLiON-SpeechEncoder extensively on several speech recognition datasets, and fine-tuned the model on ten different tasks encompassing the
SUPERB
benchmark:
automatic speech recognition
(ASR),
automatic phoneme recognition
(PR),
keyword spotting
(KS),
query by example spoken term detection
(QbE),
intent classification
(IC),
slot filling
(SF),
speaker identification
(SID),
automatic speaker verification
(ASV),
speaker diarization
(SD), and
emotion recognition
(ER). Our evaluation demonstrates improvements to spontaneous and Singapore speech benchmarks for speech recognition, while remaining competitive to other state-of-the-art speech encoders such as WavLM and HuBERT across SUPERB tasks.
This version of the MERaLiON-SpeechEncoder is specifically tailored for English, both global and Singapore-specific, including Singlish. Although the encoder was trained on a portion of multilingual data, this has not been substantially evaluated.
We provide a code snippet below for the direct usage of retrieving latent features from the model, followed by an example of how to set up the model for ASR fine-tuning. Speech input should be sampled at 16kHz.
Get Features
import torch
from datasets import load_dataset
from transformers import AutoModel, AutoFeatureExtractor
repo_id = 'MERaLiON/MERaLiON-SpeechEncoder-v1'
device = 'cuda'if torch.cuda.is_available() else'cpu'# load model and feature extractor
model = AutoModel.from_pretrained(
repo_id,
trust_remote_code=True,
)
model = model.to(device)
feature_extractor = AutoFeatureExtractor.from_pretrained(
repo_id,
trust_remote_code=True
)
# prepare data
data = load_dataset("distil-whisper/librispeech_long", "clean",
split="validation")
defbatch_collater(data):
tensors = []
for idx, sample inenumerate(data):
tensors.append(sample['audio']['array'])
return tensors
audio_array = batch_collater(data)
inputs = feature_extractor(audio_array, sampling_rate=16_000,
return_attention_mask=True,
return_tensors='pt', do_normalize=False)
input_values = inputs['input_values']
input_lengths = torch.sum(inputs['attention_mask'], dim=-1)
input_values, input_lengths = input_values.to(device), input_lengths.to(device)
# model inference to obtain featureswith torch.no_grad():
model.eval()
output = model(input_values=input_values,
input_lengths=input_lengths,
output_hidden_states=True)
Please refer to this
blog
for further ASR fine-tuning recipe with Huggingface Trainer. Alternatively, the Huggingface model can be loaded to any other frameworks such as Pytorch or ESPnet for custom fine-tuning loops.
Technical Specifications
Training Data
MERaLiON-SpeechEncoder has been trained on a diverse set of unsupervised speech data, primarily in English. Our collection is curated from various publicly available datasets and covers a wide range of conditions, encompassing factors such as domain, style, speaker, gender, and accent. The combined dataset comprises around 170,000 hours of English, including 10,000 hours of Singapore-based English that incorporates code-switching; plus 30,000 additional hours of multilingual speech from 113 languages, totalling 200,000 hours. Consult our technical report for the full breakdown.
Training Procedure and Compute
MERaLiON-SpeechEncoder was trained in two phases, initially on a 60,000 hours subset of data, before continued pre-trainining on the full 200,000 hours dataset using this prior checkpoint as initialisation. The initial model was trained on the
ASPIRE 2A
Supercomputer Cluster provided by the
National Supercomputing Centre (NSCC)
for 325K steps on 12 Nvidia A100 40GB GPUs. The full pre-training run was carried out on the
LUMI
Supercomputer Cluster with 128 AMD MI250x GPUs for a further 382K steps taking about 25 days of active GPU time.
Citation
If you find our work useful, please cite our technical report:
@misc{huzaifah2024speechfoundationmodelsingapore,
title={MERaLiON-SpeechEncoder: Towards a Speech Foundation Model for Singapore and Beyond},
author={{MERaLiON Team}},
year={2024},
eprint={2412.11538},
archivePrefix={arXiv},
primaryClass={cs.CL},
url={https://arxiv.org/abs/2412.11538},
}
Runs of MERaLiON MERaLiON-SpeechEncoder-v1 on huggingface.co
24
Total runs
0
24-hour runs
0
3-day runs
0
7-day runs
0
30-day runs
More Information About MERaLiON-SpeechEncoder-v1 huggingface.co Model
More MERaLiON-SpeechEncoder-v1 license Visit here:
MERaLiON-SpeechEncoder-v1 huggingface.co is an AI model on huggingface.co that provides MERaLiON-SpeechEncoder-v1's model effect (), which can be used instantly with this MERaLiON MERaLiON-SpeechEncoder-v1 model. huggingface.co supports a free trial of the MERaLiON-SpeechEncoder-v1 model, and also provides paid use of the MERaLiON-SpeechEncoder-v1. Support call MERaLiON-SpeechEncoder-v1 model through api, including Node.js, Python, http.
MERaLiON-SpeechEncoder-v1 huggingface.co is an online trial and call api platform, which integrates MERaLiON-SpeechEncoder-v1's modeling effects, including api services, and provides a free online trial of MERaLiON-SpeechEncoder-v1, you can try MERaLiON-SpeechEncoder-v1 online for free by clicking the link below.
MERaLiON MERaLiON-SpeechEncoder-v1 online free url in huggingface.co:
MERaLiON-SpeechEncoder-v1 is an open source model from GitHub that offers a free installation service, and any user can find MERaLiON-SpeechEncoder-v1 on GitHub to install. At the same time, huggingface.co provides the effect of MERaLiON-SpeechEncoder-v1 install, users can directly use MERaLiON-SpeechEncoder-v1 installed effect in huggingface.co for debugging and trial. It also supports api for free installation.
MERaLiON-SpeechEncoder-v1 install url in huggingface.co: