VoxLingua107 spoken language ID, Core ML

A Core ML conversion of speechbrain/lang-id-voxlingua107-ecapa (ECAPA-TDNN, ~21M parameters, 107 languages, Apache 2.0), for on-device use on macOS and iOS.

The whole SpeechBrain classify_batch path is inside the model: 16 kHz mono samples in, log-probabilities of the 107 languages out. The STFT is rebuilt as a strided convolution with the same Hamming-windowed DFT basis and the mel filterbank matrix is read from SpeechBrain, so the model needs no feature extraction in app code.

Files

File What it is
VoxLingua107.mlpackage.zip.part-aa … part-ae The zipped Core ML package in five parts of at most 8 MB (Float16, ~41 MB unzipped). Join them in order: cat VoxLingua107.mlpackage.zip.part-* > VoxLingua107.mlpackage.zip, then unzip to VoxLingua107.mlpackage
VoxLingua107.mlpackage.zip.sha256 SHA-256 of the joined zip
VoxLingua107.labels.json The 107 labels in output order, e.g. "en: English"
convert_voxlingua.py The conversion script (torch, speechbrain, coremltools)

Input and output

  • Input samples: Float32, shape [1, 160000], one 10-second window of 16 kHz mono audio in [-1, 1]. The shape is fixed: a flexible-length input crashed Core ML. Repeat shorter audio to fill the window.
  • Output logprobs: Float32, shape [1, 107], log-probabilities; exp gives probabilities that sum to 1.

Run it on the CPU and Neural Engine (MLComputeUnits.cpuAndNeuralEngine); the GPU path asserted in MPS on macOS 26. About 15 ms per window on an M1 Pro Neural Engine.

Using it well

On windows without clear speech (silence, music, distant talk) the model spreads its answer thinly over unrelated languages (top language 6-20%). Read several 10-s windows with sound in them, average only the windows whose top language reaches 50%, and treat an overall top below 40% as unsure. Close pairs come out near-tied: Spanish/Galician, Norwegian Bokmål/Nynorsk (no/nn). Hebrew is labelled iw.

Accuracy check

Matches the original SpeechBrain model within 0.004 probability on test windows; 20 of 20 synthetic voices in 20 languages identified correctly.

License

Apache 2.0, as the original model. Credit: SpeechBrain (Ravanelli et al.) and the VoxLingua107 dataset (Valk and Alumäe, 2021).

Downloads last month
-
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for ronyfadel/voxlingua107-coreml

Quantized
(19)
this model