Malagasy speech recognition (Omnilingual CTC 300M, fine-tuned)

Offline Malagasy speech-to-text for apps: commands and free text, on phones (int8 ONNX, 370 MB) or servers.

r5 against Flo976 and badrex: level on clean speech, ahead in noisy rooms; no real-phone test yet

Release candidate r5. Good enough to try; not yet proven on real phones (see Limits).

Companion model: the speaking half, darioooooo0o/malagasy-tts-mgvoca (Malagasy text to speech, 21 MB, two voices). Use both to hear a command and answer aloud, offline.

What was measured (held-out speakers) Result
Clean speech, 564 clips, 26 speakers, word error 9.99 % vs Flo976 9.91 %, badrex 10.00 %: level
Noisy rooms, short crops, 22 speakers, word error 29.7 % vs 43.2 % for Flo976 int8 (+13.5 points, CI [+8.1, +18.3])
Voice commands in real rooms, accept = 0.29 81.7 % right, 0.50 % wrong command, 1.00 % false trigger
Size 370 MB int8 ONNX (Flo976 fp32: 2.4 GB)

Quickstart

pip install onnxruntime numpy soundfile huggingface_hub
hf download darioooooo0o/malagasy-stt-300m onnx/model.int8.onnx onnx/labels.txt examples/quickstart.py --local-dir mg-stt
python mg-stt/examples/quickstart.py mg-stt clip.wav     # 16 kHz mono WAV -> Malagasy text (greedy, no LM)

The numbers in this card use beam search with the language models in lm/. For an Android app with the on-device decoder, command matching and a sample app, see the code repository's sdk/android and sdk/android-sample.

Results

All test speakers are held out (speaker-disjoint by upstream speaker IDs; none of them is in any training split).

Clean speech, 693 test clips that are absent from public Malagasy models' training data (server 4-gram LM mg4.binary). 129 of these clips are also in the validation set used to pick the checkpoint and the LM weights; the 564-clip comparison below leaves them out:

Decoding CER WER
greedy 2.83 % 12.27 %
+ 4-gram LM (alpha 0.7, beta 2.0) 2.45 % 9.98 %

Against the strongest public models, 564 clean clips / 26 speakers (LM WER): this model 9.99 %, Flo976/w2v-bert-malagasy (fp32, 2.4 GB) 9.91 %, badrex/w2v-bert-2.0-malagasy-asr 10.00 %. That is level: the speaker-clustered 95 % CIs of the differences contain zero ([-0.66, +0.45] and [-0.61, +0.60]).

Real rooms. Short command-length crops (2-6 words) from 22 held-out speakers were played through 284 real measured room impulse responses (91 rooms) with real recorded room and household noise (OpenSLR 28). On these crops this model has 29.7 % LM WER. Flo976's 612 MB int8 ONNX has 43.2 %, so this model is 13.5 points better (speaker-clustered 95 % CI [+8.1, +18.3]). Phone decoder: on-device LM mg3xs.mglm. The room and noise audio is real but was mixed digitally, not re-recorded through a phone.

Voice commands (closed-set matching, CommandSet, recommended accept = 0.29 for this model), 300 phone-style snippets, 6 command sets x 50:

Audio right wrong action false trigger
8 synthetic noise conditions, this model @0.29 84.1 % 0.21 % 1.12 %
real rooms (4 conditions), this model @0.29 81.7 % 0.50 % 1.00 %
real rooms, previous release @0.35 69.1 % 0.75 % 1.50 %

The synthetic rows use the snippets the threshold was tuned on; the real-room rows use room and noise conditions never used for tuning. A held-out check (command groups split in two) did not certify 0.30: one half had 1.50 % false triggers vs the 1.38 % cap, 2 events over, all from one command group. 0.29 is the largest value that meets every cap on both halves, but it was chosen after that check, so it is an interim value until real phone recordings confirm it. Re-check it on your own commands. At the same threshold the previous release false-triggers less (0.30: 0.83 % vs 1.21 % on the synthetic set; in real rooms v3 @0.30 is 64.2 % right / 0.33 % wrong / 0.83 % false vs r5 @0.29 81.7 / 0.50 / 1.00), so these rows compare each model at its own operating point: r5 answers many more commands right, and its wrong-action and false-trigger rates are not lower as a model property. Raising accept gives more right answers and more false triggers.

Device check (Android emulator, 3 GB RAM profile): the SDK's on-device decoder gives the same transcript as the Python reference on 38 of 40 clips. Latency: 0.79 s median per short command on emulated x86, not a real ARM phone.

Training data

Base: Meta's Omnilingual ASR CTC 300M v2 (Apache-2.0, facebookresearch/omnilingual-asr), loaded through the Hugging Face Wav2Vec2ForCTC conversion aadel4/omniASR-CTC-300M-v2.

  • Afrivoice Malagasy (Digital Umuganda, CC-BY-4.0): 153 h human-transcribed, speaker-disjoint split.
  • Round 2: + ~250 h of untranscribed Afrivoice audio labelled by this model with the LM (confidence-filtered),
    • Meta Omnilingual ASR Corpus Plateau and 10 regional Malagasy languages (CC-BY-4.0, ~126 h), with speed/noise/ telephone-band augmentation.
  • This release (r5): continued from round 2 with the model's own labels only (no third-party model labels), plus simulated room reverb and background chatter from training speakers.

Files

  • hero.png, examples/quickstart.py: the picture above and a short Python transcriber.
  • model.safetensors (+ config/tokenizer): Hugging Face Wav2Vec2ForCTC.
  • onnx/model.int8.onnx + labels.txt: audio [1, samples] 16 kHz float -> log-probs over blank, space and Malagasy letters (normalization inside the graph).
  • lm/mg4.binary + lm/unigrams.txt (4-gram KenLM, server), lm/mg3xs.mglm (63 MB compact LM for phones, read by the SDK's on-device decoder).

Limitations

  • No real-phone test yet. All test audio is held-out speakers with room and noise added in software. The pass rule for the first real-phone recordings was fixed in advance (wrong command <= 1.0 %, false trigger <= 3.0 %, right >= 80 %).
  • accept = 0.29 is interim: chosen after a held-out check did not certify 0.30. Re-check it on your own commands.
  • Level on clean speech, not better: with greedy decoding Flo976 fp32 is 0.75 points ahead (CI [-1.71, +0.02]). r5's advantage is size (370 MB vs 2.4 GB) and noisy rooms. Against the earlier r2 model it is a tie in real rooms (+2.31, CI [-0.19, +5.07]).
  • Trained mostly on read/spontaneous picture descriptions by highland speakers; regional varieties are covered by round 2 data (no per-variety accuracy is reported here).
  • French/English words inside Malagasy speech are spelled as the transcribers did; apps should register aliases.
  • Long audio: split into utterances under 30 s (the SDK's endpointer does this).

License and attribution

Apache-2.0 (base model license). Trained on CC-BY-4.0 data: credit "Afrivoice Malagasy by Digital Umuganda" and "Meta Omnilingual ASR Corpus", see NOTICE.md.

Credits

Made by @imdariotoo. The GPU training runs ran on CloudRift (V100), provided through their AI Builder Grant. Thanks to CloudRift for the compute. Evaluation ran locally on CPU.

Downloads last month
43
Safetensors
Model size
0.3B params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for darioooooo0o/malagasy-stt-300m

Quantized
(3)
this model